Skip to content
Permalink
Newer
Older
100644 120 lines (112 sloc) 3.56 KB
Ignoring revisions in .git-blame-ignore-revs.
September 2, 2021 15:12
1
# Warning: This file is generated automatically, and should not be modified.
2
# Instead, please modify the template in the pr-checks directory and run:
3
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
September 2, 2021 15:12
4
# to regenerate this file.
5
6
name: PR Check - Split workflow
7
env:
8
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9
GO111MODULE: auto
10
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
September 2, 2021 15:12
11
on:
12
push:
13
branches:
14
- main
15
- releases/v*
September 2, 2021 15:12
16
pull_request:
17
types:
18
- opened
19
- synchronize
20
- reopened
21
- ready_for_review
22
workflow_dispatch: {}
23
jobs:
24
split-workflow:
25
strategy:
26
matrix:
February 28, 2022 15:39
27
include:
28
- os: ubuntu-latest
29
version: latest
February 28, 2022 15:39
30
- os: macos-latest
31
version: latest
32
- os: ubuntu-latest
33
version: default
34
- os: macos-latest
35
version: default
36
- os: ubuntu-latest
37
version: nightly-latest
38
- os: macos-latest
39
version: nightly-latest
September 2, 2021 15:12
40
name: Split workflow
41
permissions:
42
contents: read
43
security-events: write
March 11, 2022 11:45
44
timeout-minutes: 45
September 2, 2021 15:12
45
runs-on: ${{ matrix.os }}
46
steps:
November 1, 2023 15:50
47
- name: Setup Python on MacOS
November 2, 2023 07:49
48
uses: actions/setup-python@v4
49
if: >-
50
matrix.os == 'macos-latest' && (
51
52
matrix.version == 'stable-20220908' ||
53
54
matrix.version == 'stable-20221211' ||
55
56
matrix.version == 'stable-20230418' ||
57
58
matrix.version == 'stable-v2.13.5' ||
59
60
matrix.version == 'stable-v2.14.6')
November 1, 2023 15:50
61
with:
62
python-version: '3.11'
September 2, 2021 15:12
63
- name: Check out repository
September 4, 2023 18:00
64
uses: actions/checkout@v4
September 2, 2021 15:12
65
- name: Prepare test
66
id: prepare-test
67
uses: ./.github/actions/prepare-test
September 2, 2021 15:12
68
with:
69
version: ${{ matrix.version }}
70
use-all-platform-bundle: 'false'
71
- name: Set environment variable for Swift enablement
72
if: >-
73
runner.os != 'Windows' && (
74
matrix.version == '20220908' ||
75
matrix.version == '20221211'
76
)
77
shell: bash
78
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
September 2, 2021 15:12
79
- uses: ./../action/init
80
with:
81
config-file: .github/codeql/codeql-config-packaging3.yml
April 4, 2023 12:21
82
packs: +codeql-testing/codeql-pack1@1.0.0
September 2, 2021 15:12
83
languages: javascript
84
tools: ${{ steps.prepare-test.outputs.tools-url }}
85
- name: Build code
86
shell: bash
87
run: ./build.sh
88
- uses: ./../action/analyze
89
with:
90
skip-queries: true
91
output: ${{ runner.temp }}/results
92
upload-database: false
June 19, 2022 16:44
93
September 2, 2021 15:12
94
- name: Assert No Results
95
shell: bash
96
run: |
97
if [ "$(ls -A $RUNNER_TEMP/results)" ]; then
98
echo "Expected results directory to be empty after skipping query execution!"
99
exit 1
100
fi
101
- uses: ./../action/analyze
102
with:
103
output: ${{ runner.temp }}/results
October 21, 2021 10:45
104
upload-database: false
September 2, 2021 15:12
105
- name: Assert Results
106
shell: bash
107
run: |
108
cd "$RUNNER_TEMP/results"
109
# We should have 4 hits from these rules
110
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
September 2, 2021 15:12
111
112
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
April 29, 2022 11:15
113
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
September 2, 2021 15:12
114
echo "Found matching rules '$RULES'"
115
if [ "$RULES" != "$EXPECTED_RULES" ]; then
116
echo "Did not match expected rules '$EXPECTED_RULES'."
117
exit 1
118
fi
September 28, 2021 09:25
119
env:
120
CODEQL_ACTION_TEST_MODE: true