Skip to content

Commit

Permalink
ci: checking MSRV and all feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
hackaugusto committed Apr 11, 2024
1 parent 8c405b2 commit 48d4d38
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 95 deletions.
120 changes: 35 additions & 85 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,114 +1,64 @@
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
pull_request:
types: [opened, repoened, synchronize]

jobs:
light-checks:
name: Ligth checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Clippy
run: |
rustup update --no-self-update nightly
rustup +nightly component add clippy
cargo +nightly clippy --workspace --all-targets --all-features -- -D clippy::all -D warnings
- name: Rustfmt
run: |
rustup +nightly component add rustfmt
cargo +nightly fmt --all --check
check:
name: Check with ${{matrix.features}}
name: Check all features and all targets against the MSRV
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [stable]
os: [ubuntu]
features: [--all-features, --no-default-features]
steps:
- uses: actions/checkout@main
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.toolchain}}
override: true
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --all-targets ${{matrix.features}}
- name: Perform checks
run: |
rustup update --no-self-update stable
cargo +stable install cargo-hack --locked
RUSTFLAGS=-Dwarnings cargo +stable hack check --rust-version --workspace --all-targets --ignore-private --verbose
test:
name: Test Rust ${{matrix.toolchain}} on ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [stable, nightly]
os: [ubuntu]
steps:
- uses: actions/checkout@main
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.toolchain}}
override: true
- name: Test
uses: actions-rs/cargo@v1
with:
command: test

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install minimal nightly with clippy
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: clippy
override: true

- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -D clippy::all -D warnings
env:
# Seems necessary until https://github.com/rust-lang/rust/pull/115819 is merged.
CARGO_INCREMENTAL: 0

rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install minimal nightly with rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true

- name: rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run test
run: |
rustup update --no-self-update ${{ matrix.toolchain }}
cargo +${{ matrix.toolchain }} test
no-std:
name: no-std
name: Build for no-std
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [stable, nightly]
target:
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@main
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.toolchain}}
override: true
- run: rustup target add wasm32-unknown-unknown
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --no-default-features --target ${{ matrix.target }}
- name: Build for no-std
run: |
rustup update --no-self-update ${{ matrix.toolchain }}
rustup +${{ matrix.toolchain }} target add wasm32-unknown-unknown
cargo +${{ matrix.toolchain }} build --verbose --no-default-features --target wasm32-unknown-unknown
4 changes: 2 additions & 2 deletions prover/src/trace/trace_lde/default/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn extend_trace_table() {

// build the trace polynomials, extended trace, and commitment using the default TraceLde impl
let (trace_lde, trace_polys) =
DefaultTraceLde::<BaseElement, Blake3>::new(&trace.info(), trace.main_segment(), &domain);
DefaultTraceLde::<BaseElement, Blake3>::new(trace.info(), trace.main_segment(), &domain);

// check the width and length of the extended trace
assert_eq!(2, trace_lde.main_segment_width());
Expand Down Expand Up @@ -73,7 +73,7 @@ fn commit_trace_table() {

// build the trace polynomials, extended trace, and commitment using the default TraceLde impl
let (trace_lde, _) =
DefaultTraceLde::<BaseElement, Blake3>::new(&trace.info(), trace.main_segment(), &domain);
DefaultTraceLde::<BaseElement, Blake3>::new(trace.info(), trace.main_segment(), &domain);

// build Merkle tree from trace rows
let mut hashed_states = Vec::new();
Expand Down
11 changes: 5 additions & 6 deletions utils/core/src/serde/byte_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

use alloc::{
string::{String, ToString},
vec::Vec,
};
use super::{Deserializable, DeserializationError};
use alloc::{string::String, vec::Vec};

#[cfg(feature = "std")]
use alloc::string::ToString;
#[cfg(feature = "std")]
use core::cell::{Ref, RefCell};
#[cfg(feature = "std")]
use std::io::BufRead;

use super::{Deserializable, DeserializationError};

// BYTE READER TRAIT
// ================================================================================================

Expand Down
2 changes: 0 additions & 2 deletions winterfell/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ impl Prover for LagrangeSimpleProver {
DefaultConstraintEvaluator<'a, LagrangeKernelSimpleAir, E>;

fn get_pub_inputs(&self, _trace: &Self::Trace) -> <<Self as Prover>::Air as Air>::PublicInputs {
()
}

fn options(&self) -> &ProofOptions {
Expand Down Expand Up @@ -445,7 +444,6 @@ impl Prover for LagrangeComplexProver {
DefaultConstraintEvaluator<'a, LagrangeKernelComplexAir, E>;

fn get_pub_inputs(&self, _trace: &Self::Trace) -> <<Self as Prover>::Air as Air>::PublicInputs {
()
}

fn options(&self) -> &ProofOptions {
Expand Down

0 comments on commit 48d4d38

Please sign in to comment.