From acf4440fc08a1aee3bd92e3becfbb301cbc17e0b Mon Sep 17 00:00:00 2001 From: john xu Date: Thu, 18 Jan 2024 08:49:16 +0800 Subject: [PATCH] feat: enable CI for pull request --- .github/workflows/ci.yml | 47 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3716f38..dd349ede 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,9 @@ name: CI on: push: - branches: [ "main" ] + branches: ["main"] pull_request: + branches: ["main"] env: CARGO_TERM_COLOR: always @@ -21,37 +22,37 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: risc0/risc0/.github/actions/rustup@release-0.19 - - uses: risc0/risc0/.github/actions/sccache@release-0.19 - - uses: risc0/cargo-install@v1 - with: - crate: cargo-binstall - - run: cargo binstall -y --force cargo-risczero@${{ env.RISC0_VERSION }} - - run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION - - run: cargo test --workspace --all-targets --all-features + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: risc0/risc0/.github/actions/rustup@release-0.19 + - uses: risc0/risc0/.github/actions/sccache@release-0.19 + - uses: risc0/cargo-install@v1 + with: + crate: cargo-binstall + - run: cargo binstall -y --force cargo-risczero@${{ env.RISC0_VERSION }} + - run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION + - run: cargo test --workspace --all-targets --all-features clippy: name: clippy runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v4 - - uses: risc0/risc0/.github/actions/rustup@release-0.19 - - uses: risc0/risc0/.github/actions/sccache@release-0.19 - - uses: risc0/clippy-action@main - with: - reporter: 'github-pr-check' - fail_on_error: true - clippy_flags: --workspace --all-targets --all-features -- -Dwarnings + - uses: actions/checkout@v4 + - uses: risc0/risc0/.github/actions/rustup@release-0.19 + - uses: risc0/risc0/.github/actions/sccache@release-0.19 + - uses: risc0/clippy-action@main + with: + reporter: "github-pr-check" + fail_on_error: true + clippy_flags: --workspace --all-targets --all-features -- -Dwarnings fmt: name: fmt runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v4 - - uses: risc0/risc0/.github/actions/rustup@release-0.19 - - run: cargo fmt --all --check + - uses: actions/checkout@v4 + - uses: risc0/risc0/.github/actions/rustup@release-0.19 + - run: cargo fmt --all --check