Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
chore: update ci workflow (0xPolygonZero#1475)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
leovct authored Jan 18, 2024
1 parent 39a2d62 commit 265d46a
Showing 1 changed file with 36 additions and 87 deletions.
123 changes: 36 additions & 87 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,72 +10,57 @@ 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
CARGO_INCREMENTAL: 1
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
CARGO_INCREMENTAL: 1
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
CARGO_INCREMENTAL: 1
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
Expand All @@ -85,48 +70,32 @@ 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

- name: rust-cache
uses: actions/cache@v3
targets: wasm32-unknown-unknown

- 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
CARGO_INCREMENTAL: 1
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
Expand All @@ -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

0 comments on commit 265d46a

Please sign in to comment.