From e39878c802c483db4107d84737dc16f09d7ac6f9 Mon Sep 17 00:00:00 2001 From: "alon.dotan" Date: Wed, 17 Jul 2024 15:40:55 +0300 Subject: [PATCH] chore: small optimizations for the papyrus CI --- .github/workflows/main.yml | 19 ++++++++-- .github/workflows/papyrus_ci.yml | 61 ++++---------------------------- 2 files changed, 23 insertions(+), 57 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a8c5832d7..2eedf7128d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -100,8 +100,10 @@ jobs: run: | python3 -m venv ci ci/bin/pip install -r scripts/requirements.txt - ci/bin/python scripts/run_tests.py --changes_only --commit_id ${{ github.base_ref }} - ci/bin/python scripts/run_tests.py --changes_only --features concurrency --commit_id ${{ github.base_ref }} + ci/bin/python scripts/run_tests.py --changes_only --commit_id ${{ github.event.pull_request.base.sha }} + ci/bin/python scripts/run_tests.py --changes_only --features concurrency --commit_id ${{ github.event.pull_request.base.sha }} + env: + SEED: 0 # Keep the name 'udeps' to match original action name, so we don't need to define specific branch # rules on Github for specific version branches. @@ -132,3 +134,16 @@ jobs: cargo-udeps-*/cargo-udeps udeps env: RUSTUP_TOOLCHAIN: nightly-2024-01-12 + + check: + runs-on: ubuntu-latest + env: + RUSTDOCFLAGS: "-D warnings" + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - uses: Noelware/setup-protoc@1.1.0 + with: + version: ${{env.PROTOC_VERSION}} + - run: cargo check --workspace -r --all-features diff --git a/.github/workflows/papyrus_ci.yml b/.github/workflows/papyrus_ci.yml index a842507052..b3b8b1f7c6 100644 --- a/.github/workflows/papyrus_ci.yml +++ b/.github/workflows/papyrus_ci.yml @@ -23,8 +23,6 @@ env: PROTOC_VERSION: v25.1 jobs: - - executable-run: runs-on: ubuntu-latest steps: @@ -34,10 +32,10 @@ jobs: - uses: Noelware/setup-protoc@1.1.0 with: version: ${{env.PROTOC_VERSION}} - - run: mkdir data - - name: Build node - run: cargo build -r + run: | + mkdir data + cargo build -r - name: Run executable run: > @@ -53,32 +51,16 @@ jobs: - uses: Noelware/setup-protoc@1.1.0 with: version: ${{env.PROTOC_VERSION}} - - run: mkdir data - - name: Build node - run: cargo build -r --no-default-features + run: | + mkdir data + cargo build -r --no-default-features - name: Run executable run: > target/release/papyrus_node --base_layer.node_url ${{ secrets.CI_BASE_LAYER_NODE_URL }} & sleep 30 ; kill $! - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - uses: Noelware/setup-protoc@1.1.0 - with: - version: ${{env.PROTOC_VERSION}} - - run: npm install -g ganache@7.4.3 - - - run: | - cargo test --workspace -r - env: - SEED: 0 - integration-test: runs-on: ubuntu-latest steps: @@ -109,22 +91,6 @@ jobs: env: SEED: 0 - - rustfmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - components: rustfmt - toolchain: nightly-2024-01-12 - - uses: Swatinem/rust-cache@v2 - - uses: Noelware/setup-protoc@1.1.0 - with: - version: ${{env.PROTOC_VERSION}} - - - run: cargo +nightly-2024-01-12 fmt --all -- --check - doc: runs-on: ubuntu-latest env: @@ -136,23 +102,8 @@ jobs: - uses: Noelware/setup-protoc@1.1.0 with: version: ${{env.PROTOC_VERSION}} - - run: cargo doc --workspace -r --document-private-items --no-deps - check: - runs-on: ubuntu-latest - env: - RUSTDOCFLAGS: "-D warnings" - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - uses: Noelware/setup-protoc@1.1.0 - with: - version: ${{env.PROTOC_VERSION}} - - - run: cargo check --workspace -r --all-features - codecov: runs-on: ubuntu-latest steps: