Skip to content

Commit

Permalink
[ci] spring cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
LLFourn committed Oct 6, 2023
1 parent f063160 commit e19bbd0
Showing 1 changed file with 33 additions and 57 deletions.
90 changes: 33 additions & 57 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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]
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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

0 comments on commit e19bbd0

Please sign in to comment.