Skip to content

Commit 845b8f8

Browse files
authored
Merge pull request #231 from LLFourn/actions-spring-cleaning
[ci] Spring cleaning
2 parents f052cd4 + a9440bd commit 845b8f8

File tree

7 files changed

+56
-31
lines changed

7 files changed

+56
-31
lines changed

.github/workflows/test.yml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
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
1015
env:
1116
RUSTFLAGS: "-Dwarnings"
@@ -23,6 +28,7 @@ jobs:
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
3946
- uses: dtolnay/[email protected]
4047
- 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

Cargo.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,13 @@ members = [
1111
resolver = "2"
1212

1313
[workspace.dependencies]
14-
bincode = { version = "2", default-features = false, features = ["derive"] }
14+
# External dependencies
15+
bincode = { version = "2", default-features = false, features = ["derive"] }
16+
rand_chacha = { version = "0.3", default-features = false }
17+
18+
# Local crates
19+
secp256kfun = { path = "./secp256kfun", version = "0.11", default-features = false }
20+
schnorr_fun = { path = "./schnorr_fun", version = "0.11", default-features = false }
21+
ecdsa_fun = { path = "./ecdsa_fun", version = "0.11", default-features = false }
22+
sigma_fun = { path = "./sigma_fun", version = "0.8", default-features = false }
23+
vrf_fun = { path = "./vrf_fun", version = "0.11", default-features = false }

ecdsa_fun/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ categories = ["cryptography", "cryptography::cryptocurrencies"]
1414
keywords = ["bitcoin", "ecdsa", "secp256k1"]
1515

1616
[dependencies]
17-
secp256kfun = { path = "../secp256kfun", version = "0.11", default-features = false }
18-
sigma_fun = { path = "../sigma_fun", version = "0.8", features = ["secp256k1"], default-features = false, optional = true }
19-
rand_chacha = { version = "0.3", optional = true } # needed for adaptor signatures atm but would be nice to get rid of
17+
secp256kfun = { workspace = true }
18+
sigma_fun = { workspace = true, features = ["secp256k1"], optional = true }
19+
rand_chacha = { workspace = true, optional = true } # needed for adaptor signatures atm but would be nice to get rid of
2020
bincode = { workspace = true, optional = true }
2121

2222
[dev-dependencies]

schnorr_fun/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ categories = ["cryptography", "cryptography::cryptocurrencies"]
1414
keywords = ["bitcoin", "schnorr"]
1515

1616
[dependencies]
17-
secp256kfun = { path = "../secp256kfun", version = "0.11", default-features = false }
17+
secp256kfun = { workspace = true }
1818
bech32 = { version = "0.11", optional = true, default-features = false, features = ["alloc"] }
1919
bincode = { workspace = true, optional = true }
20-
vrf_fun = { path = "../vrf_fun", version = "0.11", optional = true, default-features = false }
20+
vrf_fun = { workspace = true, optional = true }
2121
sha2 = { version = "0.10", optional = true, default-features = false }
2222

2323
[dev-dependencies]
24-
secp256kfun = { path = "../secp256kfun", version = "0.11", features = ["proptest", "bincode", "alloc"] }
24+
secp256kfun = { workspace = true, features = ["proptest", "bincode", "alloc"] }
2525
rand = { version = "0.8" }
2626
lazy_static = "1.4"
2727
sha2 = "0.10"
2828
serde_json = "1"
29-
rand_chacha = { version = "0.3" }
29+
rand_chacha = { workspace = true }
3030
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
3131
criterion = "0.4"
3232
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]

sigma_fun/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ readme = "README.md"
1616
[dependencies]
1717
generic-array = "0.14"
1818
digest = "0.10"
19-
secp256kfun = { path = "../secp256kfun", version = "0.11", default-features = false, optional = true }
19+
secp256kfun = { workspace = true, optional = true }
2020
curve25519-dalek = { package = "curve25519-dalek-ng", version = "4", default-features = false, optional = true, features = ["u64_backend"] }
2121
serde = { package = "serde", version = "1.0", optional = true, default-features = false, features = ["derive"] }
2222
bincode = { workspace = true, optional = true }
2323
rand_core = "0.6"
2424

2525
[dev-dependencies]
26-
secp256kfun = { path = "../secp256kfun", version = "0.11", default-features = false, features = ["proptest"] }
26+
secp256kfun = { workspace = true, features = ["proptest"] }
2727
rand = "0.8"
2828
sha2 = "0.10"
2929
proptest = "1"
30-
rand_chacha = "0.3"
30+
rand_chacha = { workspace = true }
3131

3232
[features]
3333
default = ["alloc", "secp256k1"]

vrf_fun/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ serde = ["dep:serde", "secp256kfun/serde", "sigma_fun/serde", "generic-array/ser
1111
bincode = ["secp256kfun/bincode", "sigma_fun/bincode", "dep:bincode"]
1212

1313
[dependencies]
14-
secp256kfun = { path = "../secp256kfun", default-features = false }
15-
sigma_fun = { path = "../sigma_fun", default-features = false, features = ["secp256k1"] }
16-
rand_chacha = { version = "0.3", default-features = false }
14+
secp256kfun = { workspace = true }
15+
sigma_fun = { workspace = true, features = ["secp256k1"] }
16+
rand_chacha = { workspace = true }
1717
serde = { version = "1.0", optional = true, default-features = false, features = ["derive"] }
1818
generic-array = { version = "0.14", default-features = false }
1919
bincode = { workspace = true, optional = true }

vrf_fun/tests/codec.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(feature = "bincode")]
2+
13
use secp256kfun::{KeyPair, prelude::*};
24
use vrf_fun::VrfProof;
35

0 commit comments

Comments
 (0)