mirror of
https://github.com/github/codeql.git
synced 2026-04-21 06:55:31 +02:00
Repositories can be configured with Default access (restricted) https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token Best practice says that workflows should declare the minimal permissions they require. Without declaring permissions, paranoid forks fail miserably.
88 lines
2.1 KiB
YAML
88 lines
2.1 KiB
YAML
name: "Go: Run Tests - Other OS"
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "go/**"
|
|
- "!go/ql/**" # don't run other-os if only ql/ files changed
|
|
- .github/workflows/go-tests-other-os.yml
|
|
- .github/actions/**
|
|
- codeql-workspace.yml
|
|
env:
|
|
GO_VERSION: '~1.21.0'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-mac:
|
|
name: Test MacOS
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Set up Go ${{ env.GO_VERSION }}
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
id: go
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up CodeQL CLI
|
|
uses: ./.github/actions/fetch-codeql
|
|
|
|
- name: Enable problem matchers in repository
|
|
shell: bash
|
|
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
|
|
|
|
- name: Build
|
|
run: |
|
|
cd go
|
|
make
|
|
|
|
- name: Cache compilation cache
|
|
id: query-cache
|
|
uses: ./.github/actions/cache-query-compilation
|
|
with:
|
|
key: go-qltest
|
|
- name: Test
|
|
run: |
|
|
cd go
|
|
make test cache="${{ steps.query-cache.outputs.cache-dir }}"
|
|
|
|
test-win:
|
|
if: github.repository_owner == 'github'
|
|
name: Test Windows
|
|
runs-on: windows-latest-xl
|
|
steps:
|
|
- name: Set up Go ${{ env.GO_VERSION }}
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
id: go
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up CodeQL CLI
|
|
uses: ./.github/actions/fetch-codeql
|
|
|
|
- name: Enable problem matchers in repository
|
|
shell: bash
|
|
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
|
|
|
|
- name: Build
|
|
run: |
|
|
cd go
|
|
make
|
|
|
|
- name: Cache compilation cache
|
|
id: query-cache
|
|
uses: ./.github/actions/cache-query-compilation
|
|
with:
|
|
key: go-qltest
|
|
|
|
- name: Test
|
|
run: |
|
|
cd go
|
|
make test cache="${{ steps.query-cache.outputs.cache-dir }}"
|