From bcd85360acb5e4a2415bab5bca6e6b3350c3f2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nurzhan=20Sak=C3=A9n?= Date: Tue, 27 Aug 2024 16:09:02 +0400 Subject: [PATCH] ci: group build_executor caches, sweep cache before saving MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nurzhan Sakén --- .github/workflows/iroha2-dev-nightly.yml | 3 +++ .github/workflows/iroha2-dev-pr-wasm.yaml | 5 +++++ .github/workflows/iroha2-dev-pr.yml | 11 +++++++++++ .github/workflows/iroha2-dev.yml | 5 +++++ .github/workflows/iroha2-pr-ui.yml | 2 ++ .github/workflows/iroha2-profiling-image.yml | 3 +++ .github/workflows/iroha2-release.yml | 3 +++ 7 files changed, 32 insertions(+) diff --git a/.github/workflows/iroha2-dev-nightly.yml b/.github/workflows/iroha2-dev-nightly.yml index 2b420bbaff4..033dda36e9b 100644 --- a/.github/workflows/iroha2-dev-nightly.yml +++ b/.github/workflows/iroha2-dev-nightly.yml @@ -19,6 +19,9 @@ jobs: # needed to build smart contracts components: rust-src - uses: Leafwing-Studios/cargo-cache@v2 + with: + cache-group: build_executor + sweep-cache: true - name: Build iroha executor run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm - name: Upload executor to reuse in other jobs diff --git a/.github/workflows/iroha2-dev-pr-wasm.yaml b/.github/workflows/iroha2-dev-pr-wasm.yaml index d8e3d0ab1ce..9a24d75f826 100644 --- a/.github/workflows/iroha2-dev-pr-wasm.yaml +++ b/.github/workflows/iroha2-dev-pr-wasm.yaml @@ -36,6 +36,9 @@ jobs: # needed to build smart contracts components: rust-src - uses: Leafwing-Studios/cargo-cache@v2 + with: + cache-group: build_executor + sweep-cache: true - name: Build iroha executor run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm - name: Upload executor to reuse in other jobs @@ -62,6 +65,8 @@ jobs: # needed to build smart contracts components: rust-src - uses: Leafwing-Studios/cargo-cache@v2 + with: + sweep-cache: true - name: Install iroha_wasm_test_runner run: cargo install --path tools/wasm_test_runner - name: Run smart contract tests on WebAssembly VM diff --git a/.github/workflows/iroha2-dev-pr.yml b/.github/workflows/iroha2-dev-pr.yml index 9a53faa9333..555287c9395 100644 --- a/.github/workflows/iroha2-dev-pr.yml +++ b/.github/workflows/iroha2-dev-pr.yml @@ -33,6 +33,8 @@ jobs: with: toolchain: ${{ env.RUST_TOOLCHAIN }} - uses: Leafwing-Studios/cargo-cache@v2 + with: + sweep-cache: true - name: Check genesis.json if: always() run: ./scripts/tests/consistency.sh genesis @@ -52,6 +54,8 @@ jobs: toolchain: ${{ env.RUST_TOOLCHAIN }} components: rustfmt, clippy - uses: Leafwing-Studios/cargo-cache@v2 + with: + sweep-cache: true - name: Format run: cargo fmt --all -- --check - name: Lints without features @@ -81,6 +85,9 @@ jobs: # needed to build smart contracts components: rust-src - uses: Leafwing-Studios/cargo-cache@v2 + with: + cache-group: build_executor + sweep-cache: true - name: Build iroha executor run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm - name: Upload executor to reuse in other jobs @@ -107,6 +114,8 @@ jobs: toolchain: ${{ env.RUST_TOOLCHAIN }} components: llvm-tools-preview - uses: Leafwing-Studios/cargo-cache@v2 + with: + sweep-cache: true - uses: taiki-e/install-action@nextest - uses: taiki-e/install-action@cargo-llvm-cov - name: Run unit tests (no default features) @@ -154,6 +163,7 @@ jobs: components: rust-src - uses: Leafwing-Studios/cargo-cache@v2 with: + sweep-cache: true cache-group: integration - uses: taiki-e/install-action@nextest - name: Run integration tests, with all features @@ -182,6 +192,7 @@ jobs: targets: aarch64-apple-darwin,wasm32-unknown-unknown - uses: Leafwing-Studios/cargo-cache@v2 with: + sweep-cache: true cache-group: integration - uses: taiki-e/install-action@nextest - name: Run integration tests, with all features diff --git a/.github/workflows/iroha2-dev.yml b/.github/workflows/iroha2-dev.yml index 234eb0cedca..b1c2da5486e 100644 --- a/.github/workflows/iroha2-dev.yml +++ b/.github/workflows/iroha2-dev.yml @@ -24,6 +24,9 @@ jobs: # needed to build smart contracts components: rust-src - uses: Leafwing-Studios/cargo-cache@v2 + with: + cache-group: build_executor + sweep-cache: true - name: Build iroha executor run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm - name: Upload executor to reuse in other jobs @@ -97,6 +100,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: Leafwing-Studios/cargo-cache@v2 + with: + sweep-cache: true - name: Run debug tests and save telemetry env: TELEMETRY_FILE: ../target/telemetry/debug.json.lz4 diff --git a/.github/workflows/iroha2-pr-ui.yml b/.github/workflows/iroha2-pr-ui.yml index efacc383f42..fcb6921791b 100644 --- a/.github/workflows/iroha2-pr-ui.yml +++ b/.github/workflows/iroha2-pr-ui.yml @@ -31,6 +31,8 @@ jobs: with: toolchain: ${{ env.RUST_TOOLCHAIN }} - uses: Leafwing-Studios/cargo-cache@v2 + with: + sweep-cache: true - uses: taiki-e/install-action@nextest - name: Run UI tests, with ${{ matrix.feature_flag }} run: cargo nextest run --no-fail-fast -E 'test(ui)' --${{ matrix.feature_flag }} diff --git a/.github/workflows/iroha2-profiling-image.yml b/.github/workflows/iroha2-profiling-image.yml index 1c2c31fd4d9..af837bc0862 100644 --- a/.github/workflows/iroha2-profiling-image.yml +++ b/.github/workflows/iroha2-profiling-image.yml @@ -45,6 +45,9 @@ jobs: # needed to build smart contracts components: rust-src - uses: Leafwing-Studios/cargo-cache@v2 + with: + cache-group: build_executor + sweep-cache: true - name: Build iroha executor run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm - name: Upload executor to reuse in other jobs diff --git a/.github/workflows/iroha2-release.yml b/.github/workflows/iroha2-release.yml index c0936738e32..78e3a717e3a 100644 --- a/.github/workflows/iroha2-release.yml +++ b/.github/workflows/iroha2-release.yml @@ -23,6 +23,9 @@ jobs: # needed to build smart contracts components: rust-src - uses: Leafwing-Studios/cargo-cache@v2 + with: + cache-group: build_executor + sweep-cache: true - name: Build iroha executor run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm - name: Upload executor to reuse in other jobs