forked from github/codeql-coding-standards
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (99 loc) · 3.24 KB
/
tooling-unit-tests.yml
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
name: 🧰 Tooling unit tests
on:
merge_group:
types: [checks_requested]
push:
branches:
- main
- "rc/**"
- next
pull_request:
branches:
- main
- "rc/**"
- next
jobs:
prepare-supported-codeql-env-matrix:
name: Prepare supported CodeQL environment matrix
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.export-supported-codeql-env-matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Export supported CodeQL environment matrix
id: export-supported-codeql-env-matrix
run: |
echo "::set-output name=matrix::$(
jq --compact-output '.supported_environment | {include: .}' supported_codeql_configs.json
)"
analysis-report-tests:
name: Run analysis report tests
needs: prepare-supported-codeql-env-matrix
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare-supported-codeql-env-matrix.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install Python dependencies
run: pip install -r scripts/reports/requirements.txt
- name: Cache CodeQL
id: cache-codeql
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/codeql_home
key: codeql-home-${{ matrix.os }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library }}
- name: Install CodeQL
if: steps.cache-codeql.outputs.cache-hit != 'true'
uses: ./.github/actions/install-codeql
with:
codeql-cli-version: ${{ matrix.codeql_cli }}
codeql-stdlib-version: ${{ matrix.codeql_standard_library }}
codeql-home: ${{ github.workspace }}/codeql_home
add-to-path: false
- name: Install CodeQL packs
uses: ./.github/actions/install-codeql-packs
with:
cli_path: ${{ github.workspace }}/codeql_home/codeql
- name: Run PyTest
env:
CODEQL_HOME: ${{ github.workspace }}/codeql_home
run: |
PATH=$PATH:$CODEQL_HOME/codeql
pytest scripts/reports/analysis_report_test.py
recategorization-tests:
name: Run Guideline Recategorization tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install Python dependencies
run: pip install -r scripts/guideline_recategorization/requirements.txt
- name: Run PyTest
run: |
pytest scripts/guideline_recategorization/recategorize_test.py
release-tests:
name: Run release tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install Python dependencies
run: pip install -r scripts/release/requirements.txt
- name: Run PyTest
run: |
pytest scripts/release/update_release_assets_test.py