From d465ae089446b9e4b84a89df93b86454d71572bd Mon Sep 17 00:00:00 2001 From: Yaroslav Kukharuk Date: Mon, 7 Sep 2026 13:01:39 +0200 Subject: [PATCH] chore(ci): harden jemalloc cache resilience --- .github/workflows/build-binaries.yml | 26 ++++++++++++++++---------- .github/workflows/juno-test.yml | 22 ++++++++++++++-------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 5e56cdd49e..c5e02b0a91 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -29,11 +29,27 @@ jobs: with: fetch-depth: 0 + - name: Install dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update -qq + sudo apt-get install -y upx-ucl libjemalloc-dev libjemalloc2 libbz2-dev + + - name: Install dependencies (macOS) + if: runner.os == 'macOS' + run: brew install jemalloc + + - name: Record the Jemalloc library path + run: pkg-config --variable=libdir jemalloc > .jemalloc-libdir + - name: Set up Go uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v6.0.0 with: go-version-file: go.mod cache: true + cache-dependency-path: | + go.mod + .jemalloc-libdir - name: Set up Rust uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @@ -56,16 +72,6 @@ jobs: OS_NAME=$([ "${{ runner.os }}" == "macOS" ] && echo "darwin" || echo "linux") echo "ARTIFACT_NAME=juno-${{ env.TAG }}-${OS_NAME}-${{ matrix.arch }}" >> $GITHUB_ENV - - name: Install dependencies (Linux) - if: runner.os == 'Linux' - run: | - sudo apt-get update -qq - sudo apt-get install -y upx-ucl libjemalloc-dev libjemalloc2 libbz2-dev - - - name: Install dependencies (macOS) - if: runner.os == 'macOS' - run: brew install jemalloc - - name: Build binary run: make juno diff --git a/.github/workflows/juno-test.yml b/.github/workflows/juno-test.yml index 40a860e675..1ef9dbef03 100644 --- a/.github/workflows/juno-test.yml +++ b/.github/workflows/juno-test.yml @@ -42,10 +42,24 @@ jobs: - 'go.sum' - '.github/workflows/juno-test.yml' + - name: Install Jemalloc (Linux) + if: runner.os == 'Linux' + run: sudo apt-get update -qq && sudo apt-get install -y libjemalloc-dev libjemalloc2 libbz2-dev + + - name: Install dependencies (macOS) + if: runner.os == 'macOS' + run: brew install jemalloc + + - name: Record the Jemalloc library path + run: pkg-config --variable=libdir jemalloc > .jemalloc-libdir + - name: Set up go uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v6.0.0 with: go-version-file: go.mod + cache-dependency-path: | + go.mod + .jemalloc-libdir - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable with: toolchain: "1.94.1" @@ -60,14 +74,6 @@ jobs: - name: Install deps run: make install-deps - - name: Install Jemalloc (Linux) - if: runner.os == 'Linux' - run: sudo apt-get update -qq && sudo apt-get install -y libjemalloc-dev libjemalloc2 libbz2-dev - - - name: Install dependencies (macOS) - if: runner.os == 'macOS' - run: brew install jemalloc - - name: Tests (Coverage) if: matrix.os == 'ubuntu-latest' env: