adding a new action to test local copies #1
This file contains 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: ⚙️ DEMO CodeQL - Validate Queries (cpp) | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
workflow_dispatch: | |
jobs: | |
create-matrix: | |
name: Create CodeQL Test Matrix | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.export-test-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install QLT | |
id: install-qlt | |
uses: ./.github/actions/install-qlt-local | |
with: | |
qlt-version: 'latest' | |
add-to-path: true | |
- name: Export test matrix | |
id: export-test-matrix | |
run: | | |
qlt test run get-matrix --os-version ubuntu-latest | |
validate-queries: | |
name: Validate Queries | |
needs: create-matrix | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install QLT | |
uses: ./.github/actions/install-qlt-local | |
with: | |
qlt-version: 'latest' | |
add-to-path: true | |
- name: Install CodeQL | |
uses: ./.github/actions/install-codeql | |
with: | |
codeql-cli-version: ${{ matrix.codeql_cli }} | |
codeql-stdlib-version: ${{ matrix.codeql_standard_library }} | |
add-to-path: true | |
- name: Verify Versions of Tooling | |
shell: bash | |
run: | | |
echo "CodeQL Home: ${{ steps.install-codeql.outputs.codeql-home }}" | |
echo -e "Checking CodeQL Version:" | |
codeql --version | |
echo -e "Checking QLT Version:" | |
echo "QLT Home: ${{ steps.install-qlt.outputs.qlt-home }}" | |
qlt version | |
- name: Install QL Packs | |
shell: bash | |
run: | | |
qlt query run install-packs --base example/ | |
- name: Run validation tests | |
shell: bash | |
run: > | |
# run a copy for pretty printing | |
qlt validation run check-queries --pretty-print | |
--language cpp --base example/ | |
# run this version to influence the outcome of the run. | |
qlt validation run check-queries | |
--language cpp --base example/ |