18
18
runs-on : ${{ matrix.host_os }}
19
19
strategy :
20
20
matrix :
21
+ features :
22
+ - # Default
21
23
host_os :
22
24
- ubuntu-18.04
23
25
- macos-latest
@@ -34,13 +36,18 @@ jobs:
34
36
with :
35
37
override : true
36
38
toolchain : ${{ matrix.rust_channel }}
39
+
37
40
- uses : actions/checkout@v2
38
- - run : cargo test -vv ${{ matrix.mode }}
41
+
42
+ - run : |
43
+ cargo test -vv ${{ matrix.features }} ${{ matrix.mode }}
39
44
40
45
test-cross-linux-linux :
41
46
runs-on : ${{ matrix.host_os }}
42
47
strategy :
43
48
matrix :
49
+ features :
50
+ - # Default
44
51
host_os :
45
52
- ubuntu-18.04
46
53
mode :
@@ -57,38 +64,16 @@ jobs:
57
64
- i686-unknown-linux-musl
58
65
- x86_64-unknown-linux-musl
59
66
steps :
60
- # qemu-user is needed only to run the tests, not for `cargo build` or
61
- # `cargo test --no-run`.
62
- - if : ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
63
- run : |
64
- sudo apt-get -yq --no-install-suggests --no-install-recommends install \
65
- gcc-aarch64-linux-gnu \
66
- libc6-dev-arm64-cross \
67
- qemu-user
68
-
69
- # qemu-user is needed only to run the tests, not for `cargo build` or
70
- # `cargo test --no-run`.
71
- - if : ${{ matrix.target == 'arm-unknown-linux-gnueabihf' }}
72
- run : |
73
- sudo apt-get -yq --no-install-suggests --no-install-recommends install \
74
- gcc-arm-linux-gnueabihf \
75
- libc6-dev-armhf-cross \
76
- qemu-user
67
+ - uses : actions/checkout@v2
77
68
78
- # TODO: musl i686 shouldn't be using gcc-multilib or libc6-dev-i386.
79
- - if : ${{ contains(matrix.target, 'i686') }}
80
- run : |
81
- sudo apt-get -yq --no-install-suggests --no-install-recommends install \
82
- gcc-multilib \
83
- libc6-dev-i386
69
+ - run : mk/install-build-tools.sh --target=${{ matrix.target }} ${{ matrix.features }}
84
70
85
71
- uses : actions-rs/toolchain@v1
86
72
with :
87
73
override : true
74
+ target : ${{ matrix.target }}
88
75
toolchain : ${{ matrix.rust_channel }}
89
76
90
- - uses : actions/checkout@v2
91
-
92
77
- run : |
93
78
CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \
94
79
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
102
87
CARGO_TARGET_i686_UNKNOWN_LINUX_MUSL_LINKER=clang \
103
88
CC_x86_64_unknown_linux_musl=clang \
104
89
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=clang \
105
- cargo test -vv ${{ matrix.mode }}
90
+ cargo test -vv --target=${{ matrix.target }} ${{ matrix.features }} ${{ matrix.mode }}
106
91
107
92
# Verify cross-compiling with the default feature set works.
108
93
build-cross-linux :
@@ -125,20 +110,16 @@ jobs:
125
110
- aarch64-linux-android
126
111
- armv7-linux-androideabi
127
112
steps :
128
- - if : ${{ contains(matrix.target, 'android') }}
129
- run : |
130
- mkdir -p "${ANDROID_SDK_ROOT}/licenses" && \
131
- echo "24333f8a63b6825ea9c5514f83c2829b004d1fee" > "${ANDROID_SDK_ROOT}/licenses/android-sdk-license" && \
132
- sudo "${ANDROID_SDK_ROOT}/tools/bin/sdkmanager" ndk-bundle
113
+ - uses : actions/checkout@v2
114
+
115
+ - run : mk/install-build-tools.sh --target=${{ matrix.target }} ${{ matrix.features }}
133
116
134
117
- uses : actions-rs/toolchain@v1
135
118
with :
136
119
override : true
137
120
target : ${{ matrix.target }}
138
121
toolchain : ${{ matrix.rust_channel }}
139
122
140
- - uses : actions/checkout@v2
141
-
142
123
# wasm32-*: When the "wasm32_c" feature isn't enabled, we don't need to set anything.
143
124
# TODO: Collect the resultant artifacts and/or run the tests.
144
125
- run : |
@@ -147,15 +128,15 @@ jobs:
147
128
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android21-clang \
148
129
CC_armv7_linux_androideabi=armv7a-linux-androideabi18-clang \
149
130
CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi18-clang \
150
- cargo test -- no-run -vv ${{ matrix.features }} ${{ matrix.mode }} --target= ${{ matrix.target }}
131
+ cargo test -vv -- no-run --target= ${{ matrix.target }} ${{ matrix.features }} ${{ matrix.mode }}
151
132
152
133
# Verify that the the "wasm32_c" configuration builds.
153
134
build-cross-wasm32-c :
154
135
runs-on : ${{ matrix.host_os }}
155
136
strategy :
156
137
matrix :
157
138
features :
158
- - --features=" wasm32_c"
139
+ - --features=wasm32_c
159
140
host_os :
160
141
- ubuntu-18.04
161
142
mode :
@@ -169,26 +150,24 @@ jobs:
169
150
- wasm32-unknown-unknown
170
151
171
152
steps :
172
- # "wasm_c" has only been tested with clang-10 and llvm-ar-10. The build
173
- # will fail when using some older versions.
174
- - run : sudo apt-get -yq --no-install-suggests --no-install-recommends install clang-10 llvm-10
153
+ - uses : actions/checkout@v2
154
+
155
+ - run : mk/install-build-tools.sh --target=${{ matrix.target }} ${{ matrix.features }}
175
156
176
157
- uses : actions-rs/toolchain@v1
177
158
with :
178
159
override : true
179
160
target : ${{ matrix.target }}
180
161
toolchain : ${{ matrix.rust_channel }}
181
162
182
- - uses : actions/checkout@v2
183
-
184
163
- env :
185
164
# These are only needed for for wasm32 targets only, only when the "wasm_c"
186
165
# feature is enabled.
187
166
CC_wasm32_unknown_unknown : clang-10
188
167
AR_wasm32_unknown_unknown : llvm-ar-10
189
168
# TODO: Collect the resultant artifacts and/or run the tests.
190
169
run : |
191
- cargo test -- no-run -vv ${{ matrix.features }} ${{ matrix.mode }} --target= ${{ matrix.target }}
170
+ cargo test -vv -- no-run --target= ${{ matrix.target }} ${{ matrix.features }} ${{ matrix.mode }}
192
171
193
172
build-cross-apple :
194
173
runs-on : ${{ matrix.host_os }}
@@ -206,14 +185,16 @@ jobs:
206
185
target :
207
186
- aarch64-apple-ios
208
187
steps :
188
+ - uses : actions/checkout@v2
189
+
190
+ - run : mk/install-build-tools.sh --target=${{ matrix.target }} ${{ matrix.features }}
191
+
209
192
- uses : actions-rs/toolchain@v1
210
193
with :
211
194
override : true
212
195
target : ${{ matrix.target }}
213
196
toolchain : ${{ matrix.rust_channel }}
214
197
215
- - uses : actions/checkout@v2
216
-
217
198
# TODO: Collect the resultant artifacts and/or run the tests.
218
199
- run : |
219
200
cargo test --no-run -vv ${{ matrix.features }} ${{ matrix.mode }} --target=${{ matrix.target }}
0 commit comments