18
18
- main
19
19
- rc/*
20
20
- codeql-cli-*
21
- push :
22
- paths :
23
- - " swift/**"
24
- - " misc/bazel/**"
25
- - " misc/codegen/**"
26
- - " shared/**"
27
- - " *.bazel*"
28
- - .github/workflows/swift.yml
29
- - .github/actions/**
30
- - codeql-workspace.yml
31
- - .pre-commit-config.yaml
32
- - " !**/*.md"
33
- - " !**/*.qhelp"
34
- branches :
35
- - main
36
- - rc/*
37
- - codeql-cli-*
38
21
39
22
permissions :
40
23
contents : read
41
24
25
+ defaults :
26
+ run :
27
+ shell : bash
28
+ working-directory : swift
29
+
42
30
jobs :
43
- # not using a matrix as you cannot depend on a specific job in a matrix, and we want to start linux checks
44
- # without waiting for the macOS build
45
- build-and-test-macos :
31
+ build-and-test :
46
32
if : github.repository_owner == 'github'
47
- runs-on : macos-13-xlarge
48
- steps :
49
- - uses : actions/checkout@v4
50
- - uses : ./swift/actions/build-and-test
51
- qltests-macos :
52
- if : ${{ github.repository_owner == 'github' && github.event_name == 'pull_request' }}
53
- needs : build-and-test-macos
54
- runs-on : macos-13-xlarge
33
+ strategy :
34
+ matrix :
35
+ runner : [ubuntu-latest, macos-13-xlarge]
36
+ fail-fast : false
37
+ runs-on : ${{ matrix.runner }}
55
38
steps :
56
39
- uses : actions/checkout@v4
57
- - uses : ./swift/actions/run-ql-tests
40
+ - name : Setup (Linux)
41
+ if : runner.os == 'Linux'
42
+ run : |
43
+ sudo apt-get update
44
+ sudo apt-get install -y uuid-dev zlib1g-dev
45
+ - name : Build Swift extractor
46
+ shell : bash
47
+ run : |
48
+ bazel run :install
49
+ - name : Run Swift tests
50
+ shell : bash
51
+ run : |
52
+ bazel test ... --test_tag_filters=-override --test_output=errors
58
53
clang-format :
59
- if : ${{ github.event_name == 'pull_request' }}
60
54
runs-on : ubuntu-latest
61
55
steps :
62
56
- uses : actions/checkout@v4
@@ -65,41 +59,24 @@ jobs:
65
59
with :
66
60
extra_args : clang-format --all-files
67
61
codegen :
68
- if : ${{ github.event_name == 'pull_request' }}
69
62
runs-on : ubuntu-latest
70
63
steps :
71
64
- uses : actions/checkout@v4
72
- - uses : bazelbuild/setup-bazelisk@v2
73
- - uses : actions/setup-python@v4
74
- with :
75
- python-version-file : ' swift/.python-version'
76
- - uses : pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
77
- name : Check that python code is properly formatted
78
- with :
79
- extra_args : autopep8 --all-files
80
65
- uses : ./.github/actions/fetch-codeql
81
66
- uses : pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
82
67
name : Check that QL generated code was checked in
83
68
with :
84
69
extra_args : swift-codegen --all-files
85
70
- name : Generate C++ files
86
71
run : |
87
- bazel run //swift/codegen: codegen -- --generate=trap,cpp --cpp-output=$PWD/generated-cpp-files
72
+ bazel run codegen -- --generate=trap,cpp --cpp-output=$PWD/generated-cpp-files
88
73
- uses : actions/upload-artifact@v4
89
74
with :
90
75
name : swift-generated-cpp-files
91
76
path : generated-cpp-files/**
92
- database-upgrade-scripts :
93
- if : ${{ github.event_name == 'pull_request' }}
94
- runs-on : ubuntu-latest
95
- steps :
96
- - uses : actions/checkout@v4
97
- - uses : ./.github/actions/fetch-codeql
98
- - uses : ./swift/actions/database-upgrade-scripts
99
77
check-no-override :
100
- if : github.event_name == 'pull_request'
101
78
runs-on : ubuntu-latest
102
79
steps :
103
80
- uses : actions/checkout@v4
104
- - shell : bash
105
- run : bazel test //swift/ ... --test_tag_filters=override --test_output=errors
81
+ - name : Check that no override is present in load.bzl
82
+ run : bazel test ... --test_tag_filters=override --test_output=errors
0 commit comments