|
| 1 | +name: ⚙️ Integration Test Bundle (cpp) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '**' |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - '**' |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + integration-test: |
| 14 | + name: Run Bundle Integration Test |
| 15 | + runs-on: ubuntu-latest |
| 16 | + permissions: |
| 17 | + actions: read |
| 18 | + contents: read |
| 19 | + security-events: write |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + language: [ 'cpp' ] |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Checkout repository |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + |
| 30 | + - name: Install QLT |
| 31 | + id: install-qlt |
| 32 | + uses: ./.github/actions/install-qlt-local |
| 33 | + with: |
| 34 | + qlt-version: 'latest' |
| 35 | + add-to-path: true |
| 36 | + |
| 37 | + |
| 38 | + - name: Validate QLT Installation |
| 39 | + shell: bash |
| 40 | + run: | |
| 41 | + echo -e "Checking QLT Version:" |
| 42 | + echo "QLT Home: ${{ steps.install-qlt.outputs.qlt-home }}" |
| 43 | + qlt version |
| 44 | +
|
| 45 | +
|
| 46 | + - name: Create Bundle (compiled) |
| 47 | + shell: bash |
| 48 | + run: | |
| 49 | + if ! qlt codeql run install --custom-bundle --base example/ ; then |
| 50 | + echo "Failed to generate bundle." |
| 51 | + exit 1 |
| 52 | + fi |
| 53 | +
|
| 54 | + # ensure bundle runs |
| 55 | +
|
| 56 | + if ! qlt query run install-packs --use-bundle --base example/ ; then |
| 57 | + echo "Failed to install query packs with tool." |
| 58 | + exit 1 |
| 59 | + fi |
| 60 | +
|
| 61 | +
|
| 62 | + - name: Validate Bundle Existence |
| 63 | + shell: bash |
| 64 | + run: | |
| 65 | + echo "Checking Bundle Existence" |
| 66 | + ls -l ${{ env.QLT_CODEQL_HOME }}/../out/ |
| 67 | +
|
| 68 | + - name: Upload Bundle Used |
| 69 | + uses: actions/upload-artifact@v2 |
| 70 | + with: |
| 71 | + name: codeql-bundle.tar.gz |
| 72 | + path: | |
| 73 | + ${{ env.QLT_CODEQL_BUNDLE_PATH }} |
| 74 | + if-no-files-found: error |
| 75 | + |
| 76 | + - name: Initialize CodeQL |
| 77 | + uses: github/codeql-action/init@v2 |
| 78 | + with: |
| 79 | + languages: ${{ matrix.language }} |
| 80 | + tools: ${{ env.QLT_CODEQL_BUNDLE_PATH }} |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + - name: Autobuild |
| 85 | + uses: github/codeql-action/autobuild@v2 |
| 86 | + with: |
| 87 | + working-directory: example/integration-tests/${{ matrix.language }}/src/ # Path containing the example application |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + - name: Perform CodeQL Analysis |
| 92 | + id: analysis |
| 93 | + uses: github/codeql-action/analyze@v2 |
| 94 | + |
| 95 | + - name: Validate SARIF Location |
| 96 | + shell: bash |
| 97 | + run: | |
| 98 | + # validate we have the actual sarif results |
| 99 | + echo "Checking SARIF file location at: ${{ steps.analysis.outputs.sarif-output }}" |
| 100 | + ls -l ${{ steps.analysis.outputs.sarif-output }} |
| 101 | +
|
| 102 | + - name: Upload SARIF Results |
| 103 | + uses: actions/upload-artifact@v2 |
| 104 | + with: |
| 105 | + name: actual.sarif |
| 106 | + path: | |
| 107 | + ${{ steps.analysis.outputs.sarif-output }}/*.sarif |
| 108 | + if-no-files-found: error |
| 109 | + |
| 110 | + - name: Validate SARIF Existence |
| 111 | + shell: bash |
| 112 | + run: | |
| 113 | + ls -l ${{ steps.analysis.outputs.sarif-output }}/*.sarif |
| 114 | +
|
| 115 | +
|
| 116 | +
|
| 117 | +
|
| 118 | + - name: Validate SARIF Results |
| 119 | + shell: bash |
| 120 | + run: | |
| 121 | + # Compare the expected vs the actual |
| 122 | + qlt bundle run validate-integration-tests --expected example/integration-tests/${{ matrix.language }}/expected.sarif --actual ${{ steps.analysis.outputs.sarif-output }}/${{ matrix.language }}.sarif |
| 123 | +
|
0 commit comments