mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 22:33:06 +00:00
chore: update ci workflow (#1475)
* chore: bump `actions/checkout` and `actions/cache` * chore: use `dtolnay/rust-toolchain` and `Swatinem/rust-cache` instead of outdated github actions * chore: use `cargo test` * chore: remove `actions-rs/cargo` * fix: typo * chore: enable to cancel in-progress jobs * chore: add job timeouts
This commit is contained in:
parent
39a2d62d6d
commit
265d46a96e
@ -10,39 +10,33 @@ on:
|
||||
branches:
|
||||
- "**"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test Suite
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install nightly toolchain
|
||||
id: rustc-toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
override: true
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
|
||||
- name: rust-cache
|
||||
uses: actions/cache@v3
|
||||
- name: Set up rust cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: rustc-test-${{ steps.rustc-toolchain.outputs.rustc_hash }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Check in plonky2 subdirectory
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --manifest-path plonky2/Cargo.toml
|
||||
run: cargo check --manifest-path plonky2/Cargo.toml
|
||||
env:
|
||||
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
|
||||
RUST_LOG: 1
|
||||
@ -50,10 +44,7 @@ jobs:
|
||||
RUST_BACKTRACE: 1
|
||||
|
||||
- name: Check in starky subdirectory
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --manifest-path starky/Cargo.toml
|
||||
run: cargo check --manifest-path starky/Cargo.toml
|
||||
env:
|
||||
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
|
||||
RUST_LOG: 1
|
||||
@ -61,10 +52,7 @@ jobs:
|
||||
RUST_BACKTRACE: 1
|
||||
|
||||
- name: Check in evm subdirectory
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --manifest-path evm/Cargo.toml
|
||||
run: cargo check --manifest-path evm/Cargo.toml
|
||||
env:
|
||||
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
|
||||
RUST_LOG: 1
|
||||
@ -72,10 +60,7 @@ jobs:
|
||||
RUST_BACKTRACE: 1
|
||||
|
||||
- name: Run cargo test
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --workspace
|
||||
run: cargo test --workspace
|
||||
env:
|
||||
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
|
||||
RUST_LOG: 1
|
||||
@ -85,37 +70,24 @@ jobs:
|
||||
wasm32:
|
||||
name: wasm32 compatibility
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install nightly wasm32 toolchain
|
||||
id: rustc-toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
- name: Install nightly toolchain
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
target: wasm32-unknown-unknown
|
||||
default: true
|
||||
override: true
|
||||
targets: wasm32-unknown-unknown
|
||||
|
||||
- name: rust-cache
|
||||
uses: actions/cache@v3
|
||||
- name: Set up rust cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: rustc-wasm32-${{ steps.rustc-toolchain.outputs.rustc_hash }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Check in plonky2 subdirectory
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --manifest-path plonky2/Cargo.toml --target wasm32-unknown-unknown --no-default-features
|
||||
run: cargo check --manifest-path plonky2/Cargo.toml --target wasm32-unknown-unknown --no-default-features
|
||||
env:
|
||||
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
|
||||
RUST_LOG: 1
|
||||
@ -123,10 +95,7 @@ jobs:
|
||||
RUST_BACKTRACE: 1
|
||||
|
||||
- name: Check in starky subdirectory
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --manifest-path starky/Cargo.toml --target wasm32-unknown-unknown --no-default-features
|
||||
run: cargo check --manifest-path starky/Cargo.toml --target wasm32-unknown-unknown --no-default-features
|
||||
env:
|
||||
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
|
||||
RUST_LOG: 1
|
||||
@ -136,44 +105,24 @@ jobs:
|
||||
lints:
|
||||
name: Formatting and Clippy
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install nightly toolchain
|
||||
id: rustc-toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: rust-cache
|
||||
uses: actions/cache@v3
|
||||
- name: Set up rust cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: rustc-lints-${{ steps.rustc-toolchain.outputs.rustc_hash }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Run cargo fmt
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
env:
|
||||
CARGO_INCREMENTAL: 1
|
||||
run: cargo fmt --all --check
|
||||
|
||||
- name: Run cargo clippy
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: --all-features --all-targets -- -D warnings -A incomplete-features
|
||||
env:
|
||||
# Seems necessary until https://github.com/rust-lang/rust/pull/115819 is merged.
|
||||
CARGO_INCREMENTAL: 0
|
||||
run: cargo clippy --all-features --all-targets -- -D warnings -A incomplete-features
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user