Skip to content

Commit 4f01931

Browse files
authored
Merge pull request #322 from nyonson/justify-ci
Just-ify CI
2 parents c4ac382 + 3e5feb7 commit 4f01931

File tree

11 files changed

+100
-1244
lines changed

11 files changed

+100
-1244
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Opt in to the v3 MSRV-aware resolver.
2+
[resolver]
3+
incompatible-rust-versions = "fallback"

.github/workflows/ci.yml

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,70 @@
1-
name: Build & Test
1+
# A few guiding principles.
2+
#
3+
# * Always use actions-rust-lang/setup-rust-toolchain for its built-in caching.
4+
# * Complexity lives in the justfile, this runner is as light as possible.
5+
6+
name: CI
27

8+
# Run on direct commits to master, including merges, and any pull requests against master.
39
on:
410
push:
511
branches:
612
- master
713
pull_request:
14+
branches:
15+
- master
816

917
jobs:
10-
build:
18+
# Quick canary of code as well as potential issues with upcoming toolchains.
19+
check:
1120
strategy:
1221
matrix:
13-
platform: [ubuntu-latest, macos-latest, windows-latest]
1422
toolchain: [stable, beta, nightly]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: extractions/setup-just@v3
27+
- uses: actions-rust-lang/setup-rust-toolchain@v1
28+
with:
29+
toolchain: ${{ matrix.toolchain }}
30+
components: clippy,rustfmt
31+
- run: just check
32+
# Build and test the code across platforms.
33+
test:
34+
strategy:
35+
matrix:
36+
platform: [ubuntu-latest, macos-latest, windows-latest]
1537
runs-on: ${{ matrix.platform }}
1638
steps:
17-
- uses: actions/checkout@v3
18-
- name: Update Toolchain
19-
run: |
20-
rustup default ${{ matrix.toolchain }}
21-
rustup component add --toolchain ${{ matrix.toolchain }} rustfmt
22-
rustup component add --toolchain ${{ matrix.toolchain }} clippy
23-
rustup update ${{ matrix.toolchain }}
24-
- name: Lint all targets
25-
run: cargo clippy --all-targets
26-
- name: Format
27-
run: cargo fmt -- --check
28-
- name: Build with defeault features
29-
run: cargo build --verbose
30-
- name: Check release build on Rust ${{ matrix.toolchain }}
31-
run: cargo check --release --verbose --color always
32-
- name: Unit test
33-
run: cargo test --verbose --lib
34-
- name: Doc test
35-
run: cargo test --verbose --doc
36-
# Check that library code can be compiled with MSRV (1.63.0).
39+
- uses: actions/checkout@v4
40+
- uses: extractions/setup-just@v3
41+
- uses: actions-rust-lang/setup-rust-toolchain@v1
42+
- run: just test unit
43+
features:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: extractions/setup-just@v3
48+
- uses: actions-rust-lang/setup-rust-toolchain@v1
49+
- run: just test features
3750
msrv:
3851
runs-on: ubuntu-latest
3952
steps:
40-
- uses: actions/checkout@v3
41-
# Modify build tools just for MSRV testing. This avoids us having
42-
# to bump our MSRV just for tooling. Tooling doesn't effect consumers so not a risk.
43-
- name: Prepare environment for MSRV toolchain
44-
run: |
45-
# Remove resolver = "3" line for MSRV compatibility. We use V3 to
46-
# generate an MSRV-compliant lockfile, but this isn't necessary to
47-
# check if library code is MSRV compliant. Any resolver can go
48-
# and grab the versions specified in the committed lockfile.
49-
#
50-
# The V3 resolver is standard in rust 1.85.
51-
sed -i '/resolver = "3"/d' Cargo.toml
52-
- name: Install MSRV toolchain
53-
run: |
54-
rustup toolchain install 1.63.0
55-
rustup default 1.63.0
56-
- name: Build with MSRV compiler
57-
run: cargo build --verbose
58-
signet:
53+
- uses: actions/checkout@v4
54+
- uses: extractions/setup-just@v3
55+
- uses: actions-rust-lang/setup-rust-toolchain@v1
56+
- run: just test msrv
57+
sync:
5958
runs-on: ubuntu-latest
6059
steps:
61-
- uses: actions/checkout@v3
62-
- name: Sync signet
63-
run: cargo test --verbose signet_syncs
64-
bitcoind:
60+
- uses: actions/checkout@v4
61+
- uses: extractions/setup-just@v3
62+
- uses: actions-rust-lang/setup-rust-toolchain@v1
63+
- run: just test sync
64+
integration:
6565
runs-on: ubuntu-latest
6666
steps:
67-
- uses: actions/checkout@v3
68-
- name: Integration test
69-
run: cargo test -- --test-threads 1 --skip signet_syncs --nocapture
67+
- uses: actions/checkout@v4
68+
- uses: extractions/setup-just@v3
69+
- uses: actions-rust-lang/setup-rust-toolchain@v1
70+
- run: just test integration

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Cargo.lock
12
/target
23
/data
34
/light_client_data

0 commit comments

Comments
 (0)