-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun-bundle-integration-tests.liquid
More file actions
162 lines (150 loc) · 4.45 KB
/
run-bundle-integration-tests.liquid
File metadata and controls
162 lines (150 loc) · 4.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: ⚙️ Integration Test Bundle ({{language}})
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
integration-test:
name: Run Bundle Integration Test
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
{% if dev_mode %}
- name: Install QLT
id: install-qlt
uses: ./.github/actions/install-qlt-local
with:
qlt-version: 'latest'
add-to-path: true
{% else %}
- name: Install QLT
id: install-qlt
uses: ./.github/actions/install-qlt
with:
qlt-version: 'latest'
add-to-path: true
{% endif %}
{% raw %}
- name: Validate QLT Installation
shell: bash
run: |
echo -e "Checking QLT Version:"
echo "QLT Home: ${{ steps.install-qlt.outputs.qlt-home }}"
qlt version
{% endraw %}
{% if dev_mode %}
- name: Create Bundle (compiled)
shell: bash
run: |
if ! qlt codeql run install --custom-bundle --base example/ ; then
echo "Failed to generate bundle."
exit 1
fi
# ensure bundle runs
if ! qlt query run install-packs --use-bundle --base example/ ; then
echo "Failed to install query packs with tool."
exit 1
fi
{% else %}
- name: Create Bundle (compiled)
shell: bash
run: |
if ! qlt codeql run install --custom-bundle ; then
echo "Failed to generate bundle."
exit 1
fi
# ensure bundle runs
if ! qlt query run install-packs --use-bundle ; then
echo "Failed to install query packs with tool."
exit 1
fi
{% endif %}
{% raw %}
- name: Validate Bundle Existence
shell: bash
run: |
echo "Checking Bundle Existence"
ls -l ${{ env.QLT_CODEQL_HOME }}/../out/
- name: Upload Bundles
uses: actions/upload-artifact@v4
with:
name: codeql-bundles
path: |
${{ env.QLT_CODEQL_BUNDLE_PATH_LINUX64 }}
${{ env.QLT_CODEQL_BUNDLE_PATH_WIN64 }}
${{ env.QLT_CODEQL_BUNDLE_PATH_OSX64 }}
if-no-files-found: error
compression-level: 0
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
tools: ${{ env.QLT_CODEQL_BUNDLE_PATH }}
{% endraw %}
{% if dev_mode %}
{% raw %}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
with:
working-directory: example/integration-tests/${{ matrix.language }}/src/ # Path containing the example application
{% endraw %}
{% else %}
{% raw %}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
with:
working-directory: integration-tests/${{ matrix.language }}/src/ # Path containing the example application
{% endraw %}
{% endif %}
{% raw %}
- name: Perform CodeQL Analysis
id: analysis
uses: github/codeql-action/analyze@v2
- name: Validate SARIF Location
shell: bash
run: |
# validate we have the actual sarif results
echo "Checking SARIF file location at: ${{ steps.analysis.outputs.sarif-output }}"
ls -l ${{ steps.analysis.outputs.sarif-output }}
- name: Upload SARIF Results
uses: actions/upload-artifact@v4
with:
name: actual.sarif
path: |
${{ steps.analysis.outputs.sarif-output }}/*.sarif
if-no-files-found: error
- name: Validate SARIF Existence
shell: bash
run: |
ls -l ${{ steps.analysis.outputs.sarif-output }}/*.sarif
{% endraw %}
{% if dev_mode %}
{% raw %}
- name: Validate SARIF Results
shell: bash
run: |
# Compare the expected vs the actual
qlt bundle run validate-integration-tests --expected example/integration-tests/${{ matrix.language }}/expected.sarif --actual ${{ steps.analysis.outputs.sarif-output }}/${{ matrix.language }}.sarif
{% endraw %}
{% else %}
{% raw %}
- name: Validate SARIF Results
shell: bash
run: |
# Compare the expected vs the actual
qlt bundle run validate-integration-tests --expected integration-tests/${{ matrix.language }}/expected.sarif --actual ${{ steps.analysis.outputs.sarif-output }}/${{ matrix.language }}.sarif
{% endraw %}
{% endif %}