13
13
pre_ci :
14
14
uses : dtolnay/.github/.github/workflows/pre_ci.yml@master
15
15
16
- test :
17
- name : ${{matrix.name || format('Rust {0}', matrix.rust)}}
18
- needs : pre_ci
19
- if : needs.pre_ci.outputs.continue
20
- runs-on : ${{matrix.os}}-latest
21
- strategy :
22
- fail-fast : false
23
- matrix :
24
- rust : [nightly, beta, stable, 1.82.0, 1.80.0, 1.77.0, 1.74.0, 1.73.0]
25
- os : [ubuntu]
26
- flags : ['']
27
- include :
28
- - name : Cargo on macOS
29
- rust : nightly
30
- os : macos
31
- - name : Cargo on Windows (msvc)
32
- rust : nightly-x86_64-pc-windows-msvc
33
- os : windows
34
- flags : /EHs
35
- - name : C++14
36
- rust : nightly
37
- os : ubuntu
38
- flags : -std=c++14
39
- - name : C++17
40
- rust : nightly
41
- os : ubuntu
42
- flags : -std=c++17
43
- - name : C++20
44
- rust : nightly
45
- os : ubuntu
46
- flags : -std=c++20
47
- env :
48
- CXXFLAGS : ${{matrix.flags}}
49
- RUSTFLAGS : --cfg deny_warnings -Dwarnings
50
- timeout-minutes : 45
51
- steps :
52
- - name : Enable symlinks (windows)
53
- if : matrix.os == 'windows'
54
- run : git config --global core.symlinks true
55
- - uses : actions/checkout@v4
56
- - uses : dtolnay/rust-toolchain@master
57
- with :
58
- toolchain : ${{matrix.rust}}
59
- components : rust-src
60
- - name : Determine test suite subset
61
- # Our Windows and macOS jobs are the longest running, so exclude the
62
- # relatively slow compiletest from them to speed up end-to-end CI time,
63
- # except during cron builds when no human is presumably waiting on the
64
- # build. The extra coverage is not particularly valuable and we can
65
- # still ensure the test is kept passing on the basis of the scheduled
66
- # builds.
67
- run : |
68
- echo RUSTFLAGS=$RUSTFLAGS >> $GITHUB_ENV
69
- echo exclude=--exclude cxx-test-suite ${{matrix.rust == '1.73.0' && '--exclude cxxbridge-cmd' || ''}} >> $GITHUB_OUTPUT
70
- env :
71
- RUSTFLAGS : ${{env.RUSTFLAGS}} ${{matrix.os != 'ubuntu' && github.event_name != 'schedule' && '--cfg skip_ui_tests' || ''}}
72
- id : testsuite
73
- shell : bash
74
- - name : Ignore macOS linker warning
75
- run : echo RUSTFLAGS=${RUSTFLAGS}\ -Alinker_messages >> $GITHUB_ENV
76
- if : matrix.os == 'macos'
77
- - run : cargo run --manifest-path demo/Cargo.toml
78
- - run : cargo test --workspace ${{steps.testsuite.outputs.exclude}}
79
- if : matrix.rust != '1.74.0' && matrix.rust != '1.73.0'
80
- - run : cargo check --no-default-features --features alloc
81
- env :
82
- RUSTFLAGS : --cfg compile_error_if_std ${{env.RUSTFLAGS}}
83
- - run : cargo check --no-default-features
84
- env :
85
- RUSTFLAGS : --cfg compile_error_if_alloc --cfg cxx_experimental_no_alloc ${{env.RUSTFLAGS}}
86
- - uses : actions/upload-artifact@v4
87
- if : matrix.os == 'ubuntu' && matrix.rust == 'nightly' && always()
88
- with :
89
- name : Cargo.lock
90
- path : Cargo.lock
91
- continue-on-error : true
92
-
93
- reindeer :
94
- name : Reindeer
95
- runs-on : ubuntu-latest
96
- if : github.event_name != 'pull_request'
97
- timeout-minutes : 45
98
- steps :
99
- - uses : actions/checkout@v4
100
- - uses : dtolnay/rust-toolchain@stable
101
- with :
102
- components : rust-src
103
- - uses : dtolnay/install@reindeer
104
- - run : reindeer buckify
105
- working-directory : third-party
106
- - name : Check reindeer-generated BUCK file up to date
107
- run : git diff --exit-code
108
-
109
16
bazel :
110
17
name : Bazel on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}}
111
18
runs-on : ${{matrix.os}}-latest
@@ -129,57 +36,20 @@ jobs:
129
36
- name : Check MODULE.bazel.lock up to date
130
37
run : git diff --exit-code
131
38
- run : bazel run //third-party:vendor
132
- if : matrix.os == 'ubuntu' || matrix.os == 'macos'
39
+ if : matrix.os == 'ubuntu'
133
40
- name : Check third-party/bazel up to date
134
41
run : git diff --exit-code
135
- if : matrix.os == 'ubuntu' || matrix.os == 'macos'
136
-
137
- minimal :
138
- name : Minimal versions
139
- needs : pre_ci
140
- if : needs.pre_ci.outputs.continue
141
- runs-on : ubuntu-latest
142
- timeout-minutes : 45
143
- steps :
144
- - uses : actions/checkout@v4
145
- - uses : dtolnay/rust-toolchain@nightly
146
- - run : cargo generate-lockfile -Z minimal-versions
147
- - run : cargo check --locked --workspace
148
-
149
- doc :
150
- name : Documentation
151
- needs : pre_ci
152
- if : needs.pre_ci.outputs.continue
153
- runs-on : ubuntu-latest
154
- timeout-minutes : 45
155
- env :
156
- RUSTDOCFLAGS : -Dwarnings
157
- steps :
158
- - uses : actions/checkout@v4
159
- - uses : dtolnay/rust-toolchain@nightly
160
- with :
161
- components : rust-src
162
- - uses : dtolnay/install@cargo-docs-rs
163
- - run : cargo docs-rs
164
- - run : cargo docs-rs -p cxx-build
165
- - run : cargo docs-rs -p cxx-gen
166
- - run : cargo docs-rs -p cxxbridge-flags
167
- - run : cargo docs-rs -p cxxbridge-macro
42
+ if : matrix.os == 'ubuntu'
168
43
169
44
clippy :
170
45
name : Clippy
171
46
runs-on : ubuntu-latest
172
47
if : github.event_name != 'pull_request'
173
48
timeout-minutes : 45
174
- env :
175
- RUSTFLAGS : -Dwarnings
176
49
steps :
177
50
- uses : actions/checkout@v4
178
- - uses : dtolnay/rust-toolchain@nightly
179
- with :
180
- components : clippy, rust-src
181
- - run : cargo clippy --workspace --tests --exclude demo -- -Dclippy::all -Dclippy::pedantic
182
- - run : cargo clippy --manifest-path demo/Cargo.toml -- -Dclippy::all
51
+ - run : sudo apt-get install lld
52
+ - run : bazel build --config=clippy ... --verbose_failures --noshow_progress
183
53
184
54
clang-tidy :
185
55
name : Clang Tidy
@@ -204,14 +74,3 @@ jobs:
204
74
working-directory : book
205
75
- run : npx eslint
206
76
working-directory : book
207
-
208
- outdated :
209
- name : Outdated
210
- runs-on : ubuntu-latest
211
- if : github.event_name != 'pull_request'
212
- timeout-minutes : 45
213
- steps :
214
- - uses : actions/checkout@v4
215
- - uses : dtolnay/rust-toolchain@stable
216
- - uses : dtolnay/install@cargo-outdated
217
- - run : cargo outdated --workspace --exit-code 1
0 commit comments