Repository navigation
DO NOT MERGE: Remove caching steps from QL4QL workflows #1662
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run QL for QL Tests | |
| on: | |
| push: | |
| branches: ['henrymercer/test-ql4ql-*'] | |
| env: | |
| CODEQL_ACTION_PER_LANGUAGE_BUNDLES: "true" | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: read | |
| jobs: | |
| qltest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Find codeql | |
| id: find-codeql | |
| uses: github/codeql-action/setup-codeql@main | |
| with: | |
| tools: nightly | |
| - name: Check formatting | |
| run: cd ql; cargo fmt -- --check | |
| - name: Build extractor | |
| run: | | |
| cd ql; | |
| codeqlpath=$(dirname ${{ steps.find-codeql.outputs.codeql-path }}); | |
| env "PATH=$PATH:$codeqlpath" ./scripts/create-extractor-pack.sh | |
| - name: Run QL tests | |
| run: | | |
| "${CODEQL}" test run --threads=0 --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path "${{ github.workspace }}" --consistency-queries ql/ql/consistency-queries ql/ql/test | |
| env: | |
| CODEQL: ${{ steps.find-codeql.outputs.codeql-path }} | |
| other-os: | |
| strategy: | |
| matrix: | |
| os: [macos-latest, windows-latest] | |
| needs: [qltest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install GNU tar | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install gnu-tar | |
| echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH | |
| - name: Find codeql | |
| id: find-codeql | |
| uses: github/codeql-action/setup-codeql@main | |
| with: | |
| tools: nightly | |
| - name: Build extractor | |
| if: runner.os != 'Windows' | |
| run: | | |
| cd ql; | |
| codeqlpath=$(dirname ${{ steps.find-codeql.outputs.codeql-path }}); | |
| env "PATH=$PATH:$codeqlpath" ./scripts/create-extractor-pack.sh | |
| - name: Build extractor (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| cd ql; | |
| $Env:PATH += ";$(dirname ${{ steps.find-codeql.outputs.codeql-path }})" | |
| pwsh ./scripts/create-extractor-pack.ps1 | |
| - name: Run a single QL tests - Unix | |
| if: runner.os != 'Windows' | |
| run: | | |
| "${CODEQL}" test run --threads=0 --check-databases --search-path "${{ github.workspace }}" ql/ql/test/queries/style/DeadCode/DeadCode.qlref | |
| env: | |
| CODEQL: ${{ steps.find-codeql.outputs.codeql-path }} | |
| - name: Run a single QL tests - Windows | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $Env:PATH += ";$(dirname ${{ steps.find-codeql.outputs.codeql-path }})" | |
| codeql test run --threads=0 --check-databases --search-path "${{ github.workspace }}" ql/ql/test/queries/style/DeadCode/DeadCode.qlref |