Skip to content

Commit dc5c8a0

Browse files
authored
Improve test reliability (#45)
* Switch to official rust action * Try to restrict to one thread * Use nightly for all steps of coverage-enabled part
1 parent 0bbdf8a commit dc5c8a0

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/build.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ jobs:
2727
- uses: actions/checkout@v4
2828
with:
2929
persist-credentials: false
30-
- name: Stable with rustfmt and clippy
31-
uses: dtolnay/rust-toolchain@master
30+
- name: Setup rust
31+
uses: actions-rust-lang/setup-rust-toolchain@v1
3232
with:
3333
toolchain: ${{matrix.rust}}
3434
- name: Release build
3535
run: cargo build --release --all-features
3636
- name: Quick test
37-
run: cargo test --all-features
37+
# The node doesn't seem to enjoy us sending a lot of requests concurrently.
38+
run: cargo test --all-features -- --test-threads=1
3839

3940
test:
4041
name: Test
@@ -47,7 +48,7 @@ jobs:
4748

4849
- uses: actions/setup-python@v5
4950
- name: Install nightly toolchain
50-
uses: dtolnay/rust-toolchain@nightly
51+
uses: actions-rust-lang/setup-rust-toolchain@v1
5152
with:
5253
toolchain: nightly
5354
components: rustfmt, clippy
@@ -61,15 +62,15 @@ jobs:
6162
tool: cargo-tarpaulin,cargo-rdme
6263

6364
- name: Check README is up-to-date
64-
run: cargo rdme --check
65+
run: cargo +nightly rdme --check
6566

6667
- name: Run tests with coverage
6768
run: RUST_BACKTRACE=1 cargo +nightly tarpaulin --out Xml --all-features --doc --tests
6869

6970
- name: Submit several transactions to chain
7071
run: |
71-
RUST_BACKTRACE=1 cargo run --example transaction_broadcast --all-features
72-
RUST_BACKTRACE=1 cargo run --example contract_interaction --all-features
72+
RUST_BACKTRACE=1 cargo +nightly run --example transaction_broadcast --all-features
73+
RUST_BACKTRACE=1 cargo +nightly run --example contract_interaction --all-features
7374
env:
7475
TEST_TO_ADDRESS: ${{ secrets.TO_ADDRESS }}
7576
TEST_MNEMONIC: ${{ secrets.MNEMONIC }}

.github/workflows/release.yml

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ jobs:
4444
with:
4545
fetch-depth: 1
4646
persist-credentials: false
47+
- name: Setup rust
48+
uses: actions-rust-lang/setup-rust-toolchain@v1
49+
with:
50+
toolchain: stable
51+
cache: false
4752
- name: Publish crate to crates.io
4853
run: |
4954
name=$(cargo metadata -q --no-deps | jq -r '.packages[0].name')

0 commit comments

Comments
 (0)