Skip to content

Commit c4619ea

Browse files
committed
Update CI for transition from main branch
1 parent 97e45ea commit c4619ea

File tree

1 file changed

+50
-86
lines changed

1 file changed

+50
-86
lines changed

.github/workflows/build.yaml

+50-86
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Build
22

3-
on:
4-
push:
5-
pull_request:
6-
schedule:
7-
- cron: "0 0 * * 6" # midnight on Saturdays
3+
on: [push, pull_request]
84

95
jobs:
106
check-other-targets:
@@ -35,13 +31,6 @@ jobs:
3531
- name: Checkout sources
3632
uses: actions/checkout@v2
3733

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-
4534
- name: Install toolchain
4635
uses: actions-rs/toolchain@v1
4736
with:
@@ -51,13 +40,9 @@ jobs:
5140
override: true
5241

5342
- 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
6146
6247
- name: Cache cargo output
6348
uses: actions/cache@v2
@@ -72,21 +57,39 @@ jobs:
7257
uses: actions-rs/cargo@v1
7358
with:
7459
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 }}
7667
if: matrix.target.std == false
7768

7869
- name: Check feature powerset
7970
uses: actions-rs/cargo@v1
8071
with:
8172
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 }}
8380
if: matrix.rust == '1.32.0' && matrix.target.std == true
8481

8582
- name: Check feature powerset
8683
uses: actions-rs/cargo@v1
8784
with:
8885
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 }}
9093
if: matrix.rust != '1.32.0' && matrix.target.std == true
9194

9295
check-web:
@@ -116,11 +119,6 @@ jobs:
116119
override: true
117120

118121
- 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
124122
run: cargo +stable install cargo-web
125123
if: steps.cache.outputs.cache-hit != 'true'
126124

@@ -165,13 +163,6 @@ jobs:
165163
- name: Checkout sources
166164
uses: actions/checkout@v2
167165

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-
175166
- name: Install toolchain
176167
uses: actions-rs/toolchain@v1
177168
with:
@@ -180,20 +171,25 @@ jobs:
180171
override: true
181172

182173
- 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
190186
191187
# This is a workaround for a known bug in GitHub Actions. See
192188
# actions/cache#403 and rust-lang/cargo#8603 for details.
193189
- name: Install GNU tar
194190
run: |
195191
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
197193
if: matrix.os == 'macOS-latest'
198194

199195
- name: Cache cargo output
@@ -209,14 +205,24 @@ jobs:
209205
uses: actions-rs/cargo@v1
210206
with:
211207
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
213214
if: matrix.rust == '1.32.0'
214215

215216
- name: Test feature powerset (--tests)
216217
uses: actions-rs/cargo@v1
217218
with:
218219
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
220226
if: matrix.rust != '1.32.0'
221227

222228
- name: Test documentation
@@ -276,45 +282,3 @@ jobs:
276282
with:
277283
token: ${{ secrets.GITHUB_TOKEN }}
278284
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

Comments
 (0)