-
Notifications
You must be signed in to change notification settings - Fork 270
251 lines (237 loc) · 8.02 KB
/
main.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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: CI
on:
push:
branches:
- auto
- try
pull_request:
branches:
- master
jobs:
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: ci/style.sh
docs:
name: Build Documentation
needs: [style]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: ci/dox.sh
env:
CI: 1
- name: Publish documentation
run: |
cd target/doc
git init
git add .
git -c user.name='ci' -c user.email='ci' commit -m init
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
verify:
name: Automatic intrinsic verification
needs: [style]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: cargo test --manifest-path crates/stdarch-verify/Cargo.toml
env_override:
name: Env Override
needs: [style]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: RUST_STD_DETECT_UNSTABLE=avx cargo test --features=std_detect_env_override --manifest-path crates/std_detect/Cargo.toml env_override_no_avx
shell: bash
test:
needs: [style]
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
target:
# Dockers that are run through docker on linux
- i686-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-gnu-emulated
- arm-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
# MIPS targets disabled since they are dropped to tier 3.
# See https://github.com/rust-lang/compiler-team/issues/648
#- mips-unknown-linux-gnu
#- mips64-unknown-linux-gnuabi64
#- mips64el-unknown-linux-gnuabi64
#- mipsel-unknown-linux-musl
- s390x-unknown-linux-gnu
- wasm32-wasip1
- i586-unknown-linux-gnu
- nvptx64-nvidia-cuda
- thumbv6m-none-eabi
- thumbv7m-none-eabi
- thumbv7em-none-eabi
- thumbv7em-none-eabihf
- loongarch64-unknown-linux-gnu
# macOS targets
- x86_64-apple-darwin
- aarch64-apple-darwin
# FIXME: gh-actions build environment doesn't have linker support
# - i686-apple-darwin
# Windows targets
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
- aarch64-pc-windows-msvc
- x86_64-pc-windows-gnu
# - i686-pc-windows-gnu:
include:
- target: i686-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-gnu-emulated
os: ubuntu-latest
test_everything: true
rustflags: --cfg stdarch_intel_sde
disable_assert_instr: true
- target: arm-unknown-linux-gnueabihf
os: ubuntu-latest
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
# MIPS targets disabled since they are dropped to tier 3.
# See https://github.com/rust-lang/compiler-team/issues/648
#- target: mips-unknown-linux-gnu
# os: ubuntu-latest
# norun: true
#- target: mips64-unknown-linux-gnuabi64
# os: ubuntu-latest
# norun: true
#- target: mips64el-unknown-linux-gnuabi64
# os: ubuntu-latest
# norun: true
#- target: mipsel-unknown-linux-musl
# os: ubuntu-latest
# norun: 1
- target: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
disable_assert_instr: true
- target: s390x-unknown-linux-gnu
os: ubuntu-latest
- target: wasm32-wasip1
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
norun: true # https://github.com/rust-lang/stdarch/issues/1206
- target: aarch64-apple-ios-macabi
os: macos-latest
norun: true # https://github.com/rust-lang/stdarch/issues/1206
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-13
- target: x86_64-apple-ios-macabi
os: macos-13
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: i686-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
norun: true
- target: x86_64-pc-windows-gnu
os: windows-latest
- target: i586-unknown-linux-gnu
os: ubuntu-latest
- target: nvptx64-nvidia-cuda
os: ubuntu-latest
- target: thumbv6m-none-eabi
os: ubuntu-latest
- target: thumbv7m-none-eabi
os: ubuntu-latest
- target: thumbv7em-none-eabi
os: ubuntu-latest
- target: thumbv7em-none-eabihf
os: ubuntu-latest
- target: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
- target: loongarch64-unknown-linux-gnu
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
run: |
rustup update nightly --no-self-update
rustup default nightly
- run: rustup target add ${{ matrix.target }}
if: "!endsWith(matrix.target, 'emulated')"
- run: cargo generate-lockfile
# Configure some env vars based on matrix configuration
- run: echo "NORUN=1" >> $GITHUB_ENV
shell: bash
if: matrix.norun != '' || startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'
- run: echo "STDARCH_TEST_EVERYTHING=1" >> $GITHUB_ENV
shell: bash
if: matrix.test_everything != ''
- run: echo "RUSTFLAGS=${{ matrix.rustflags }}" >> $GITHUB_ENV
shell: bash
if: matrix.rustflags != ''
- run: echo "STDARCH_DISABLE_ASSERT_INSTR=1" >> $GITHUB_ENV
shell: bash
if: matrix.disable_assert_instr != ''
- run: echo "NOSTD=1" >> $GITHUB_ENV
shell: bash
if: startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'
# Windows & OSX go straight to `run.sh` ...
- run: ./ci/run.sh
shell: bash
if: matrix.os != 'ubuntu-latest' || startsWith(matrix.target, 'thumb')
env:
TARGET: ${{ matrix.target }}
# ... while Linux goes to `run-docker.sh`
- run: ./ci/run-docker.sh ${{ matrix.target }}
shell: bash
if: "matrix.os == 'ubuntu-latest' && !startsWith(matrix.target, 'thumb')"
env:
TARGET: ${{ matrix.target }}
build-std-detect:
needs: [style]
name: Build std_detect
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: ./ci/build-std-detect.sh
success:
needs:
- docs
- verify
- env_override
- test
- build-std-detect
runs-on: ubuntu-latest
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'