chore: update CI jobs

This commit is contained in:
Bobbin Threadbare 2024-01-05 21:57:39 -08:00 committed by Bobbin Threadbare
parent 004a3bc7a8
commit ac7593a13c
3 changed files with 64 additions and 55 deletions

View file

@ -4,46 +4,74 @@ on:
branches: branches:
- main - main
pull_request: pull_request:
types: [opened, repoened, synchronize] types: [opened, reopened, synchronize]
jobs: jobs:
build: rustfmt:
name: Build ${{matrix.toolchain}} on ${{matrix.os}} with ${{matrix.args}} name: rustfmt ${{matrix.toolchain}} on ${{matrix.os}}
runs-on: ${{matrix.os}}-latest runs-on: ${{matrix.os}}-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
toolchain: [stable, nightly] toolchain: [nightly]
os: [ubuntu] os: [ubuntu]
target: [wasm32-unknown-unknown]
args: [--no-default-features --target wasm32-unknown-unknown]
steps: steps:
- uses: actions/checkout@main - uses: actions/checkout@v4
with: - name: Install minimal Rust with rustfmt
submodules: recursive
- name: Install rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal
toolchain: ${{matrix.toolchain}} toolchain: ${{matrix.toolchain}}
components: rustfmt
override: true override: true
- run: rustup target add ${{matrix.target}} - name: fmt
- name: Test
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: build command: fmt
args: ${{matrix.args}} args: --all -- --check
clippy:
name: clippy ${{matrix.toolchain}} on ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
toolchain: [nightly]
os: [ubuntu]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install minimal Rust with clippy
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{matrix.toolchain}}
components: clippy
override: true
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D clippy::all -D warnings
- name: Clippy all features
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D clippy::all -D warnings
test: test:
name: Test ${{matrix.toolchain}} on ${{matrix.os}} with ${{matrix.features}} name: test ${{matrix.toolchain}} on ${{matrix.os}} with ${{matrix.args}}
runs-on: ${{matrix.os}}-latest runs-on: ${{matrix.os}}-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
toolchain: [stable, nightly] toolchain: [stable, nightly]
os: [ubuntu] os: [ubuntu]
features: ["--features default,std,serde", --no-default-features] features: ["--features default,serde", --no-default-features]
timeout-minutes: 30
steps: steps:
- uses: actions/checkout@main - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Install rust - name: Install rust
@ -57,45 +85,25 @@ jobs:
command: test command: test
args: ${{matrix.features}} args: ${{matrix.features}}
clippy: no-std:
name: Clippy with ${{matrix.features}} name: build ${{matrix.toolchain}} no-std for wasm32-unknown-unknown
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
features: ["--features default,std,serde", --no-default-features] toolchain: [stable, nightly]
steps: steps:
- uses: actions/checkout@main - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Install minimal nightly with clippy - name: Install rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal toolchain: ${{matrix.toolchain}}
toolchain: nightly
components: clippy
override: true override: true
- name: Clippy - run: rustup target add wasm32-unknown-unknown
- name: Build
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: clippy command: build
args: --all ${{matrix.features}} -- -D clippy::all -D warnings args: --no-default-features --target wasm32-unknown-unknown
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install minimal stable with rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
override: true
- name: rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

View file

@ -50,7 +50,7 @@ winter_utils = { version = "0.7", package = "winter-utils", default-features = f
[dev-dependencies] [dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] } criterion = { version = "0.5", features = ["html_reports"] }
proptest = "1.3" proptest = "1.4"
rand_utils = { version = "0.7", package = "winter-rand-utils" } rand_utils = { version = "0.7", package = "winter-rand-utils" }
[build-dependencies] [build-dependencies]

View file

@ -114,13 +114,14 @@ const LEAVES: [RpoDigest; 7] = [
#[test] #[test]
fn test_mmr_simple() { fn test_mmr_simple() {
let mut postorder = Vec::new(); let mut postorder = vec![
postorder.push(LEAVES[0]); LEAVES[0],
postorder.push(LEAVES[1]); LEAVES[1],
postorder.push(merge(LEAVES[0], LEAVES[1])); merge(LEAVES[0], LEAVES[1]),
postorder.push(LEAVES[2]); LEAVES[2],
postorder.push(LEAVES[3]); LEAVES[3],
postorder.push(merge(LEAVES[2], LEAVES[3])); merge(LEAVES[2], LEAVES[3]),
];
postorder.push(merge(postorder[2], postorder[5])); postorder.push(merge(postorder[2], postorder[5]));
postorder.push(LEAVES[4]); postorder.push(LEAVES[4]);
postorder.push(LEAVES[5]); postorder.push(LEAVES[5]);