-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,32 +10,38 @@ on: | |
# Make sure CI fails on all warnings, including Clippy lints | ||
env: | ||
RUSTFLAGS: "-Dwarnings" | ||
RUSTDOCFLAGS: "-Dwarnings" | ||
|
||
jobs: | ||
|
||
fmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
components: rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
- run: cargo fmt --all -- --check | ||
|
||
clippy_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Clippy | ||
run: cargo clippy --all-targets --all-features | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo clippy --all-targets --all-features --tests | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/[email protected] | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo tree --all-features # to debug deps issues | ||
- run: cargo build --release --all-features | ||
|
||
# We want to test stable on multiple platforms with --all-features | ||
test: | ||
|
@@ -45,11 +51,11 @@ jobs: | |
matrix: | ||
target: ["x86_64-unknown-linux-gnu", "armv7-unknown-linux-gnueabihf"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: 1.60.0 | ||
toolchain: stable | ||
target: ${{ matrix.target }} | ||
override: true | ||
- uses: Swatinem/[email protected] | ||
|
@@ -65,18 +71,10 @@ jobs: | |
test-nightly: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
target: "x86_64-unknown-linux-gnu" | ||
override: true | ||
- uses: Swatinem/[email protected] | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --release --all-features | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo test --release --all-features | ||
|
||
# test without default features | ||
test-minimal: | ||
|
@@ -85,18 +83,10 @@ jobs: | |
matrix: | ||
package: [ "secp256kfun", "sigma_fun", "ecdsa_fun", "schnorr_fun" ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
target: "x86_64-unknown-linux-gnu" | ||
override: true | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: Swatinem/[email protected] | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --release --no-default-features -p ${{ matrix.package }} | ||
- run: cargo test --release --no-default-features -p ${{ matrix.package }} | ||
|
||
|
||
# test with alloc feature only | ||
|
@@ -106,30 +96,16 @@ jobs: | |
matrix: | ||
package: [ "secp256kfun", "sigma_fun", "ecdsa_fun", "schnorr_fun" ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
target: "x86_64-unknown-linux-gnu" | ||
override: true | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: Swatinem/[email protected] | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --release --no-default-features --features alloc -p ${{ matrix.package }} | ||
- run: cargo test --release --no-default-features --features alloc -p ${{ matrix.package }} | ||
|
||
|
||
doc-build: | ||
name: doc-build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- name: build-doc | ||
# convoluted way to make it fail on warnings | ||
run: "cargo doc --no-deps --workspace 2>&1 | tee /dev/fd/2 | grep -iEq '^(warning|error)' && exit 1 || exit 0" | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- run: cargo doc --no-deps --workspace |