-
Notifications
You must be signed in to change notification settings - Fork 78
215 lines (205 loc) · 8.41 KB
/
Copy pathtest.yml
File metadata and controls
215 lines (205 loc) · 8.41 KB
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
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [master]
paths-ignore: ['*.mkd', 'LICENSE']
pull_request:
types: [opened, reopened, synchronize]
jobs:
test:
name: "Test: ${{ toJSON(matrix) }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
rust_toolchain: [nightly, stable, 1.54.0]
os: [ubuntu-latest, windows-latest, macOS-latest]
mode: ['--release', '-Zminimal-versions', '']
exclude:
- rust_toolchain: stable
mode: -Zminimal-versions
- rust_toolchain: 1.54.0
mode: -Zminimal-versions
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- run: rustup install ${{ matrix.rust_toolchain }} --profile=minimal
- run: rustup default ${{ matrix.rust_toolchain }}
- run: cargo test --all ${{ matrix.mode }} -- --nocapture
- run: cargo test --all ${{ matrix.mode }} --examples -- --nocapture
test-windows:
name: "Test: ${{ toJSON(matrix) }}"
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
rust_toolchain: [stable]
rust_target:
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
- x86_64-pc-windows-gnu
- i686-pc-windows-gnu
include:
- rust_target: x86_64-pc-windows-msvc
clang_cl: C:/msys64/mingw64/bin/clang-cl.exe
package: mingw-w64-x86_64-clang
- rust_target: i686-pc-windows-msvc
clang_cl: C:/msys64/mingw32/bin/clang-cl.exe
package: mingw-w64-i686-clang
- rust_target: x86_64-pc-windows-gnu
mingw_path: C:/msys64/mingw64/bin
package: mingw-w64-x86_64-gcc
- rust_target: i686-pc-windows-gnu
mingw_path: C:/msys64/mingw32/bin
package: mingw-w64-i686-gcc
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
release: false
install: ${{ matrix.package }}
- run: echo "c:/msys64/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
- run: echo "${{ matrix.mingw_path }}" | Out-File -FilePath $env:GITHUB_PATH -Append
if: ${{ matrix.mingw_path }}"
- run: rustup install ${{ matrix.rust_toolchain }} --profile=minimal
- run: rustup default ${{ matrix.rust_toolchain }}
- run: rustup target add ${{ matrix.rust_target }}
- run: cargo test --target=${{ matrix.rust_target }} --all -- --nocapture
env:
CC: ${{ matrix.clang_cl }}
cross:
name: "Cross: ${{ toJSON(matrix) }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust_toolchain: [stable, nightly]
rust_target:
- aarch64-linux-android
- aarch64-unknown-linux-gnu
- arm-linux-androideabi
- arm-unknown-linux-gnueabi
- armv7-linux-androideabi
- armv7-unknown-linux-gnueabihf
- i686-unknown-freebsd
- i686-unknown-linux-gnu
- i686-unknown-linux-musl
- mips64el-unknown-linux-gnuabi64
- mips64-unknown-linux-gnuabi64
- mipsel-unknown-linux-gnu
- mips-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- powerpc-unknown-linux-gnu
- s390x-unknown-linux-gnu
- sparc64-unknown-linux-gnu
- x86_64-linux-android
- x86_64-unknown-freebsd
- x86_64-unknown-linux-musl
- x86_64-unknown-netbsd
mode: ['--release', '-Zminimal-versions', '']
exclude:
- mode: '-Zminimal-versions'
rust_toolchain: stable
include:
# BSDs: could be tested with full system emulation
- rust_target: x86_64-unknown-netbsd
build_only: true
- rust_target: i686-unknown-freebsd
build_only: true
- rust_target: x86_64-unknown-freebsd
build_only: true
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- run: rustup install ${{ matrix.rust_toolchain }} --profile=minimal
- run: rustup default ${{ matrix.rust_toolchain }}
- run: rustup target add ${{ matrix.rust_target }}
- run: |
mkdir -p "${{ runner.tool_cache }}/cross"
curl --fail -L 'https://github.com/cross-rs/cross/releases/download/v0.2.4/cross-x86_64-unknown-linux-gnu.tar.gz' | tar xzf - -C "${{ runner.tool_cache }}/cross"
echo "${{ runner.tool_cache }}/cross" >> $GITHUB_PATH
- run: cross build --target ${{ matrix.rust_target }} --all ${{ matrix.mode }}
if: matrix.build_only == true
- run: cross test --target ${{ matrix.rust_target }} --all ${{ matrix.mode }} -- --test-threads=1 --nocapture
if: matrix.build_only != true
cross-ios-build:
name: "Cross: ${{ toJSON(matrix) }}"
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
rust_toolchain: [nightly, stable]
rust_target:
- aarch64-apple-ios
- x86_64-apple-ios
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- run: rustup install ${{ matrix.rust_toolchain }} --profile=minimal
- run: rustup default ${{ matrix.rust_toolchain }}
- run: rustup target add ${{ matrix.rust_target }}
- run: cargo build --target=${{ matrix.rust_target }} --all
cross-windows-build:
name: "Cross: ${{ toJSON(matrix) }}"
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
rust_toolchain: [stable]
rust_target:
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
xwin_version: ["0.1.6"]
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- run: rustup install ${{ matrix.rust_toolchain }} --profile=minimal
- run: rustup default ${{ matrix.rust_toolchain }}
- run: rustup target add ${{ matrix.rust_target }}
- name: Add toolchain shims
run: |
sudo ln -s clang-12 /usr/bin/clang-cl
sudo ln -s llvm-ar-12 /usr/bin/llvm-lib
sudo ln -s lld-link-12 /usr/bin/lld-link
- run: |
set -eux
xwin_version=${{ matrix.xwin_version }}
xwin_prefix="xwin-$xwin_version-x86_64-unknown-linux-musl"
# Install xwin to cargo/bin via github release. Note you could also just use `cargo install xwin`.
curl --fail -L https://github.com/Jake-Shadle/xwin/releases/download/$xwin_version/$xwin_prefix.tar.gz | tar -xzv -C /home/runner/.cargo/bin --strip-components=1 $xwin_prefix/xwin
# Splat the CRT and SDK files to /tmp/xwin/crt and /tmp/xwin/sdk respectively
xwin --accept-license 1 splat --output /tmp/xwin
- run: cargo build --target ${{ matrix.rust_target }} --all
env:
CC: "clang-cl"
CXX: "clang-cl"
AR: "llvm-lib"
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: "lld-link"
CARGO_TARGET_I686_PC_WINDOWS_MSVC_LINKER: "lld-link"
# Note that we only disable unused-command-line-argument here since clang-cl
# doesn't implement all of the options supported by cl, but the ones it doesn't
# are _generally_ not interesting.
CFLAGS: "-Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/tmp/xwin/crt/include /imsvc/tmp/xwin/sdk/include/ucrt /imsvc/tmp/xwin/sdk/include/um /imsvc/tmp/xwin/sdk/include/shared"
# Inform the linker where to search for libraries
RUSTFLAGS: "-Lnative=/tmp/xwin/crt/lib/x86_64 -Lnative=/tmp/xwin/sdk/lib/um/x86_64 -Lnative=/tmp/xwin/sdk/lib/ucrt/x86_64"
test-wasm:
name: "Test: ${{ toJSON(matrix) }}"
runs-on: ubuntu-latest
strategy:
matrix:
rust_toolchain: [stable]
rust_target: [wasm32-wasi]
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- run: rustup install ${{ matrix.rust_toolchain }} --profile=minimal
- run: rustup default ${{ matrix.rust_toolchain }}
- run: rustup target add ${{ matrix.rust_target }}
- run: |
curl -Lf https://github.com/bytecodealliance/wasmtime/releases/download/v0.19.0/wasmtime-v0.19.0-x86_64-linux.tar.xz | tar xJf - -C ${{ runner.tool_cache }}
echo "${{ runner.tool_cache }}/wasmtime-v0.19.0-x86_64-linux" >> $GITHUB_PATH
echo "CARGO_TARGET_WASM32_WASI_RUNNER=wasmtime run --" >> $GITHUB_ENV
- run: cargo test --target ${{ matrix.rust_target }} --all -- --nocapture