Skip to content

Commit 39e47fb

Browse files
committed
Merge #414: Improve CI pipeline
0fd07ad Improve CI pipeline (Tobin Harding) Pull request description: We have unnecessary runs of the `test.sh` script. We can simplify the CI pipeline and at the same time improve the docs build by using `--cfg docsrs`. - Remove the `wasm` job, replace it by enabling the `DO_WASM` env var for the stable toolchain run in the `Tests` job. - Add `--cfg docrs` flag to the docs build and set the `DO_DOCS` env var as part of the nightly toolchain run in `Tests` job. The end result is one less run of the `test.sh` script and better test coverage. Idea came from @Kixunil when reviewing rust-bitcoin/rust-bitcoin#858, thanks. ACKs for top commit: apoelstra: ACK 0fd07ad Tree-SHA512: 063493ce03aa8cef5d7fc7636f3bfaaeff5c918d7076473bac23313082e8357d5282fcaf4d76a3dc5b0650e7ee43fa9d2b738f79863be7f24f2acf32f99da4b1
2 parents 50b7c25 + 0fd07ad commit 39e47fb

File tree

2 files changed

+18
-33
lines changed

2 files changed

+18
-33
lines changed

.github/workflows/rust.yml

+16-31
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,26 @@ jobs:
2929
DO_BENCH: true
3030
run: ./contrib/test.sh
3131

32-
wasm:
33-
name: Stable - Docs / WebAssembly Build
34-
runs-on: ubuntu-latest
35-
strategy:
36-
matrix:
37-
rust:
38-
- stable
39-
steps:
40-
- name: Checkout Crate
41-
uses: actions/checkout@v2
42-
- name: Checkout Toolchain
43-
uses: actions-rs/toolchain@v1
44-
with:
45-
profile: minimal
46-
toolchain: ${{ matrix.rust }}
47-
override: true
48-
- name: Building docs
49-
env:
50-
DO_DOCS: true
51-
run: ./contrib/test.sh
52-
- name: Running WASM build
53-
env:
54-
DO_WASM: true
55-
run: ./contrib/test.sh
56-
5732
Tests:
5833
name: Tests
5934
runs-on: ubuntu-latest
6035
strategy:
6136
matrix:
62-
rust:
63-
- 1.29.0
64-
- beta
65-
- stable
37+
include:
38+
- rust: stable
39+
env:
40+
DO_FEATURE_MATRIX: true
41+
DO_WASM: true
42+
- rust: beta
43+
env:
44+
DO_FEATURE_MATRIX: true
45+
- rust: nightly
46+
env:
47+
DO_FEATURE_MATRIX: true
48+
DO_DOCS: true
49+
- rust: 1.29.0
50+
env:
51+
DO_FEATURE_MATRIX: true
6652
steps:
6753
- name: Checkout Crate
6854
uses: actions/checkout@v2
@@ -76,7 +62,6 @@ jobs:
7662
if: matrix.rust == '1.29.0'
7763
run: cargo generate-lockfile --verbose && cargo update -p cc --precise "1.0.41" --verbose
7864
- name: Running cargo
79-
env:
80-
DO_FEATURE_MATRIX: true
65+
env: ${{ matrix.env }}
8166
run: ./contrib/test.sh
8267

contrib/test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ if [ "$DO_FEATURE_MATRIX" = true ]; then
5757
cargo run --example generate_keys --features=std,rand-std
5858
fi
5959

60-
# Docs
60+
# Build the docs if told to (this only works with the nightly toolchain)
6161
if [ "$DO_DOCS" = true ]; then
62-
cargo doc --all --features="$FEATURES"
62+
RUSTDOCFLAGS="--cfg docsrs" cargo doc --all --features="$FEATURES"
6363
fi
6464

6565
# Webassembly stuff

0 commit comments

Comments
 (0)