From a45646ac47c635a5d4a14bb4da666926b744b6ee Mon Sep 17 00:00:00 2001 From: 0o-de-lally <1364012+0o-de-lally@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:18:00 -0500 Subject: [PATCH 1/5] deduplicate cache --- .github/actions/build_env/action.yaml | 6 ------ .github/workflows/ci.yaml | 9 ++++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/actions/build_env/action.yaml b/.github/actions/build_env/action.yaml index 28f86aeae..54c7fc8e2 100644 --- a/.github/actions/build_env/action.yaml +++ b/.github/actions/build_env/action.yaml @@ -34,12 +34,6 @@ runs: shell: bash run: rustup component add rustfmt clippy - - name: also rust cache - uses: Swatinem/rust-cache@v2.7.0 - with: - shared-key: "libra" - cache-on-failure: "true" - # call own action for libra_cli # known issue with needing to hard code the @version # https://github.com/orgs/community/discussions/41927 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 10c46fb94..6da406ae7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -52,7 +52,7 @@ jobs: shared-key: "libra-framework" cache-all-crates: true - # fail fast if types doesnt compile, everything else will fail. + # fail fast if types doesn't compile, everything else will fail. - name: types working-directory: ./types run: cargo test --no-fail-fast @@ -258,17 +258,14 @@ jobs: - uses: actions/checkout@v3 - name: setup env - # if: ${{runner.environment == 'self-hosted'}} uses: ./.github/actions/build_env - uses: actions/download-artifact@v4.1.2 - # if: ${{runner.environment == 'self-hosted'}} with: name: framework-build path: framework/ - name: rescue if: always() - # if: ${{runner.environment == 'self-hosted'}} working-directory: ./tools/rescue run: RUST_MIN_STACK=104857600 cargo test --no-fail-fast -- --test-threads=1 storage: @@ -277,6 +274,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: setup env uses: ./.github/actions/build_env @@ -284,9 +282,9 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + - name: storage working-directory: ./tools/storage - # TODO: not testing the V6 file parsing run: cargo test --no-fail-fast twin-testsuite: @@ -295,6 +293,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: setup env uses: ./.github/actions/build_env From 493e8ac72048057067edbfc52dc846405b75b529 Mon Sep 17 00:00:00 2001 From: 0o-de-lally <1364012+0o-de-lally@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:26:26 -0500 Subject: [PATCH 2/5] cache on failure --- .github/workflows/ci.yaml | 16 ++++++++++++++++ .github/workflows/cleanliness.yaml | 1 + 2 files changed, 17 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6da406ae7..ae293aa68 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,6 +51,7 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + cache-on-failure: true # fail fast if types doesn't compile, everything else will fail. - name: types @@ -71,6 +72,7 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + cache-on-failure: true - name: wallet if: always() @@ -98,6 +100,7 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + cache-on-failure: true # Check test suite meta tests - name: smoke-tests # NOTE: needs working DIEM_FORGE_NODE_BIN_PATH @@ -118,6 +121,7 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + cache-on-failure: true - uses: actions/download-artifact@v4.1.2 with: @@ -144,6 +148,7 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + cache-on-failure: true - uses: actions/download-artifact@v4.1.2 with: @@ -169,6 +174,7 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + cache-on-failure: true - uses: actions/download-artifact@v4.1.2 with: @@ -208,6 +214,7 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + cache-on-failure: true - uses: actions/download-artifact@v4.1.2 with: @@ -260,6 +267,12 @@ jobs: - name: setup env uses: ./.github/actions/build_env + - uses: Swatinem/rust-cache@v2.7.3 + with: + shared-key: "libra-framework" + cache-all-crates: true + cache-on-failure: true + - uses: actions/download-artifact@v4.1.2 with: name: framework-build @@ -282,6 +295,7 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + cache-on-failure: true - name: storage working-directory: ./tools/storage @@ -301,6 +315,8 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + cache-on-failure: true + - name: twin working-directory: ./testsuites/twin run: cargo test --no-fail-fast diff --git a/.github/workflows/cleanliness.yaml b/.github/workflows/cleanliness.yaml index a355d226e..e50bf1399 100644 --- a/.github/workflows/cleanliness.yaml +++ b/.github/workflows/cleanliness.yaml @@ -29,6 +29,7 @@ jobs: with: shared-key: "libra-framework" cache-all-crates: true + cache-on-failure: true - name: format uses: actions-rs/cargo@v1 From c0b3ccd52b3f661fe36d925dd6ec64a0cebe8c93 Mon Sep 17 00:00:00 2001 From: 0o-de-lally <1364012+0o-de-lally@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:31:41 -0500 Subject: [PATCH 3/5] test rust cache v2 --- .github/workflows/ci.yaml | 20 ++++++++++---------- .github/workflows/cleanliness.yaml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ae293aa68..b4fca6119 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,7 +47,7 @@ jobs: - name: setup env uses: ./.github/actions/build_env - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true @@ -68,7 +68,7 @@ jobs: - name: setup env uses: ./.github/actions/build_env - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true @@ -96,7 +96,7 @@ jobs: name: framework-build path: framework/ - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true @@ -117,7 +117,7 @@ jobs: - name: setup env uses: ./.github/actions/build_env - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true @@ -144,7 +144,7 @@ jobs: - name: setup env uses: ./.github/actions/build_env - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true @@ -170,7 +170,7 @@ jobs: - name: setup env uses: ./.github/actions/build_env - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true @@ -210,7 +210,7 @@ jobs: - name: setup env uses: ./.github/actions/build_env - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true @@ -267,7 +267,7 @@ jobs: - name: setup env uses: ./.github/actions/build_env - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true @@ -291,7 +291,7 @@ jobs: - name: setup env uses: ./.github/actions/build_env - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true @@ -311,7 +311,7 @@ jobs: - name: setup env uses: ./.github/actions/build_env - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true diff --git a/.github/workflows/cleanliness.yaml b/.github/workflows/cleanliness.yaml index e50bf1399..7062dd639 100644 --- a/.github/workflows/cleanliness.yaml +++ b/.github/workflows/cleanliness.yaml @@ -25,7 +25,7 @@ jobs: - name: setup env uses: ./.github/actions/build_env - - uses: Swatinem/rust-cache@v2.7.3 + - uses: Swatinem/rust-cache@v2 with: shared-key: "libra-framework" cache-all-crates: true From 44afa2f4dc864d2ecd0159c1ce291aa87b577ef7 Mon Sep 17 00:00:00 2001 From: 0o-de-lally <1364012+0o-de-lally@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:01:19 -0500 Subject: [PATCH 4/5] test add sccache --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b4fca6119..82eea7ec5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -216,6 +216,9 @@ jobs: cache-all-crates: true cache-on-failure: true + - name: Run sccache-cache + uses: mozilla-actions/sccache-action + - uses: actions/download-artifact@v4.1.2 with: name: framework-build From 74625e0f6c0135bb86aff80fa3bafbf93b73f271 Mon Sep 17 00:00:00 2001 From: 0o-de-lally <1364012+0o-de-lally@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:42:54 -0500 Subject: [PATCH 5/5] patch --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 82eea7ec5..f6d110041 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -217,7 +217,7 @@ jobs: cache-on-failure: true - name: Run sccache-cache - uses: mozilla-actions/sccache-action + uses: mozilla-actions/sccache-action@v0.0.7 - uses: actions/download-artifact@v4.1.2 with: