1
1
name : Build
2
2
3
- on :
4
- push :
5
- pull_request :
6
- schedule :
7
- - cron : " 0 0 * * 6" # midnight on Saturdays
3
+ on : [push, pull_request]
8
4
9
5
jobs :
10
6
check-other-targets :
35
31
- name : Checkout sources
36
32
uses : actions/checkout@v2
37
33
38
- - name : Cache installed binaries
39
- uses : actions/cache@v2
40
- id : cache-binaries
41
- with :
42
- path : ~/.cargo/bin
43
- key : ${{ runner.os }}-cargo-hack
44
-
45
34
- name : Install toolchain
46
35
uses : actions-rs/toolchain@v1
47
36
with :
51
40
override : true
52
41
53
42
- name : Install cargo-hack
54
- # uses: actions-rs/[email protected]
55
- # with:
56
- # crate: cargo-hack
57
- # version: ^0.3
58
- # use-tool-cache: true
59
- run : cargo +stable install cargo-hack
60
- if : steps.cache-binaries.outputs.cache-hit != 'true'
43
+ shell : bash
44
+ run : |
45
+ curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
61
46
62
47
- name : Cache cargo output
63
48
uses : actions/cache@v2
@@ -72,21 +57,39 @@ jobs:
72
57
uses : actions-rs/cargo@v1
73
58
with :
74
59
command : hack
75
- args : check --no-dev-deps --feature-powerset --optional-deps --skip default,libc,winapi,stdweb,std --target ${{ matrix.target.triple }}
60
+ args : |
61
+ check
62
+ --no-dev-deps
63
+ --feature-powerset
64
+ --optional-deps
65
+ --exclude-features default,libc,winapi,stdweb,std
66
+ --target ${{ matrix.target.triple }}
76
67
if : matrix.target.std == false
77
68
78
69
- name : Check feature powerset
79
70
uses : actions-rs/cargo@v1
80
71
with :
81
72
command : hack
82
- args : check --no-dev-deps --feature-powerset --optional-deps --skip default,libc,winapi,stdweb,std --features std --target ${{ matrix.target.triple }}
73
+ args : |
74
+ check
75
+ --no-dev-deps
76
+ --feature-powerset
77
+ --optional-deps
78
+ --exclude-features default,libc,winapi,stdweb --features std
79
+ --target ${{ matrix.target.triple }}
83
80
if : matrix.rust == '1.32.0' && matrix.target.std == true
84
81
85
82
- name : Check feature powerset
86
83
uses : actions-rs/cargo@v1
87
84
with :
88
85
command : hack
89
- args : check --no-dev-deps --feature-powerset --optional-deps --skip default,libc,winapi,stdweb --target ${{ matrix.target.triple }}
86
+ args : |
87
+ check
88
+ --no-dev-deps
89
+ --feature-powerset
90
+ --optional-deps
91
+ --exclude-features default,libc,winapi,stdweb
92
+ --target ${{ matrix.target.triple }}
90
93
if : matrix.rust != '1.32.0' && matrix.target.std == true
91
94
92
95
check-web :
@@ -116,11 +119,6 @@ jobs:
116
119
override : true
117
120
118
121
- name : Install cargo-web
119
- # uses: actions-rs/[email protected]
120
- # with:
121
- # crate: cargo-web
122
- # version: ^0.6
123
- # use-tool-cache: true
124
122
run : cargo +stable install cargo-web
125
123
if : steps.cache.outputs.cache-hit != 'true'
126
124
@@ -165,13 +163,6 @@ jobs:
165
163
- name : Checkout sources
166
164
uses : actions/checkout@v2
167
165
168
- - name : Cache installed binaries
169
- uses : actions/cache@v2
170
- id : cache-binaries
171
- with :
172
- path : ~/.cargo/bin
173
- key : ${{ runner.os }}-cargo-hack
174
-
175
166
- name : Install toolchain
176
167
uses : actions-rs/toolchain@v1
177
168
with :
@@ -180,20 +171,25 @@ jobs:
180
171
override : true
181
172
182
173
- name : Install cargo-hack
183
- # uses: actions-rs/[email protected]
184
- # with:
185
- # crate: cargo-hack
186
- # version: ^0.3
187
- # use-tool-cache: true
188
- run : cargo +stable install cargo-hack
189
- if : steps.cache-binaries.outputs.cache-hit != 'true'
174
+ shell : bash
175
+ run : |
176
+ host=$(rustc -Vv | grep host | sed 's/host: //')
177
+ if [[ $host =~ windows ]]; then
178
+ curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-${host}.zip -o cargo-hack.zip
179
+ 7z x cargo-hack.zip -o$HOME/.cargo/bin
180
+ elif [[ $host =~ darwin|linux ]]; then
181
+ curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-${host}.tar.gz | tar xzf - -C ~/.cargo/bin
182
+ else
183
+ echo "unsupported operating system"
184
+ exit 1
185
+ fi
190
186
191
187
# This is a workaround for a known bug in GitHub Actions. See
192
188
# actions/cache#403 and rust-lang/cargo#8603 for details.
193
189
- name : Install GNU tar
194
190
run : |
195
191
brew install gnu-tar
196
- echo "::add-path:: /usr/local/opt/gnu-tar/libexec/gnubin"
192
+ echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
197
193
if : matrix.os == 'macOS-latest'
198
194
199
195
- name : Cache cargo output
@@ -209,14 +205,24 @@ jobs:
209
205
uses : actions-rs/cargo@v1
210
206
with :
211
207
command : hack
212
- args : test --feature-powerset --optional-deps --skip default,libc,winapi,stdweb,std --features std --tests
208
+ args : |
209
+ test
210
+ --feature-powerset
211
+ --optional-deps
212
+ --exclude-features default,libc,winapi,stdweb --features std
213
+ --tests
213
214
if : matrix.rust == '1.32.0'
214
215
215
216
- name : Test feature powerset (--tests)
216
217
uses : actions-rs/cargo@v1
217
218
with :
218
219
command : hack
219
- args : test --feature-powerset --optional-deps --skip default,libc,winapi,stdweb --tests
220
+ args : |
221
+ test
222
+ --feature-powerset
223
+ --optional-deps
224
+ --exclude-features default,libc,winapi,stdweb
225
+ --tests
220
226
if : matrix.rust != '1.32.0'
221
227
222
228
- name : Test documentation
@@ -276,45 +282,3 @@ jobs:
276
282
with :
277
283
token : ${{ secrets.GITHUB_TOKEN }}
278
284
args : --all-features
279
-
280
- documentation :
281
- name : Documentation
282
- runs-on : ubuntu-latest
283
- # ensure docs only get pushed if everything else is successful
284
- needs :
285
- - check-other-targets
286
- - check-web
287
- - test
288
- - fmt
289
- - clippy
290
-
291
- steps :
292
- - name : Checkout
293
- uses : actions/checkout@v2
294
- with :
295
- persist-credentials : false
296
-
297
- - name : Install toolchain
298
- uses : actions-rs/toolchain@v1
299
- with :
300
- profile : minimal
301
- toolchain : nightly
302
- override : true
303
-
304
- - name : Build documentation
305
- uses : actions-rs/cargo@v1
306
- with :
307
- command : doc
308
- args : --all-features
309
- env :
310
- RUSTFLAGS : --cfg __time_02_docs
311
- RUSTDOCFLAGS : --cfg __time_02_docs
312
-
313
- - name : Publish documentation
314
- uses : JamesIves/github-pages-deploy-action@releases/v3
315
- with :
316
- ACCESS_TOKEN : ${{ secrets.ACCESS_TOKEN }}
317
- BRANCH : gh-pages
318
- FOLDER : target/doc
319
- SINGLE_COMMIT : true
320
- if : github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.master_branch)
0 commit comments