66 - master
77 pull_request :
88
9+ # Cancel in-progress jobs when a new commit is pushed to the same PR or branch
10+ concurrency :
11+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+ cancel-in-progress : true
13+
914# Make sure CI fails on all warnings, including Clippy lints
1015env :
1116 RUSTFLAGS : " -Dwarnings"
2328 - run : cargo fmt --all -- --check
2429
2530 clippy_check :
31+ name : Clippy
2632 runs-on : ubuntu-latest
2733 steps :
2834 - uses : actions/checkout@v4
@@ -33,40 +39,45 @@ jobs:
3339 - run : cargo clippy --all-targets --all-features --tests
3440
3541 build :
42+ name : Build
3643 runs-on : ubuntu-latest
3744 steps :
3845 - uses : actions/checkout@v4
39464047 - uses : Swatinem/rust-cache@v2
41- - run : cargo tree --all-features # to debug deps issues
4248 - run : cargo build --release --all-features
4349
4450 # We want to test stable on multiple platforms with --all-features
4551 test :
52+ name : Test on ${{ matrix.target }}
4653 runs-on : ubuntu-latest
4754 strategy :
4855 fail-fast : false
4956 matrix :
5057 target : ["x86_64-unknown-linux-gnu", "armv7-unknown-linux-gnueabihf"]
5158 steps :
5259 - uses : actions/checkout@v4
53- - uses : actions-rs/ toolchain@v1
60+ - uses : dtolnay/rust- toolchain@stable
5461 with :
55- profile : minimal
56- toolchain : stable
57- target : ${{ matrix.target }}
58- override : true
59- -
uses :
Swatinem/[email protected] 62+ targets : ${{ matrix.target }}
63+ - uses : Swatinem/rust-cache@v2
6064
61- - name : test-on-target
62- uses : actions-rs/cargo@v1
63- with :
64- use-cross : ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
65- command : test
66- args : --all-features --release --target ${{ matrix.target }}
65+ # Use cross for non-x86_64 targets
66+ - name : Install cross
67+ if : matrix.target != 'x86_64-unknown-linux-gnu'
68+ uses : taiki-e/install-action@cross
69+
70+ - name : Test
71+ run : |
72+ if [ "${{ matrix.target }}" = "x86_64-unknown-linux-gnu" ]; then
73+ cargo test --all-features --release --target ${{ matrix.target }}
74+ else
75+ cross test --all-features --release --target ${{ matrix.target }}
76+ fi
6777
6878 # test nightly build/test
6979 test-nightly :
80+ name : Test Nightly
7081 runs-on : ubuntu-latest
7182 steps :
7283 - uses : actions/checkout@v4
@@ -76,30 +87,33 @@ jobs:
7687
7788 # test without default features
7889 test-minimal :
90+ name : Test Minimal (${{ matrix.package }})
7991 runs-on : ubuntu-latest
8092 strategy :
8193 matrix :
82- package : ["secp256kfun", "sigma_fun", "ecdsa_fun", "schnorr_fun"]
94+ package :
95+ ["secp256kfun", "sigma_fun", "ecdsa_fun", "schnorr_fun", "vrf_fun"]
8396 steps :
8497 - uses : actions/checkout@v4
8598 - uses : dtolnay/rust-toolchain@stable
86- - uses : Swatinem/rust-cache@v2.0.0
99+ - uses : Swatinem/rust-cache@v2
87100 - run : cargo test --release --no-default-features -p ${{ matrix.package }}
88101
89102 # test with alloc feature only
90103 test-alloc :
104+ name : Test Alloc (${{ matrix.package }})
91105 runs-on : ubuntu-latest
92106 strategy :
93107 matrix :
94108 package : ["secp256kfun", "sigma_fun", "ecdsa_fun", "schnorr_fun"]
95109 steps :
96110 - uses : actions/checkout@v4
97111 - uses : dtolnay/rust-toolchain@stable
98- - uses : Swatinem/rust-cache@v2.0.0
112+ - uses : Swatinem/rust-cache@v2
99113 - run : cargo test --release --no-default-features --features alloc -p ${{ matrix.package }}
100114
101115 doc-build :
102- name : doc-build
116+ name : Documentation
103117 runs-on : ubuntu-latest
104118 steps :
105119 - uses : actions/checkout@v4
0 commit comments