diff options
| author | tobtoht <tob@featherwallet.org> | 2026-05-25 12:07:33 +0200 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2026-05-25 19:25:02 +0200 |
| commit | 459e4fc241e22cbecf1654799340de843551dc68 (patch) | |
| tree | d39523dd5f099083ff9c0fb9b9f886dbff96f8d3 /.github | |
| parent | 54f009ae9adf7e1f740e96673e39717813fae35f (diff) | |
| download | monzero-core-459e4fc241e22cbecf1654799340de843551dc68.tar.gz monzero-core-459e4fc241e22cbecf1654799340de843551dc68.tar.xz monzero-core-459e4fc241e22cbecf1654799340de843551dc68.zip | |
ci: don't save caches for pull requests
Co-authored-by: selsta <selsta@sent.at>
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/build.yml | 82 | ||||
| -rw-r--r-- | .github/workflows/depends.yml | 33 |
2 files changed, 89 insertions, 26 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7132adc9c..7be529b2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,9 @@ jobs: - uses: actions/checkout@v5 with: submodules: recursive - - uses: actions/cache@v5 + - name: restore ccache + uses: actions/cache/restore@v5 + id: ccache-restore with: path: /Users/runner/Library/Caches/ccache key: ccache-${{ runner.os }}-build-${{ github.sha }} @@ -50,6 +52,12 @@ jobs: run: | ${{env.CCACHE_SETTINGS}} make -j${{env.MAKE_JOB_COUNT}} + - name: save ccache + uses: actions/cache/save@v5 + if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true' + with: + path: /Users/runner/Library/Caches/ccache + key: ${{ steps.ccache-restore.outputs.cache-primary-key }} build-windows: name: 'Windows (MSYS2)' @@ -64,7 +72,9 @@ jobs: - uses: actions/checkout@v5 with: submodules: recursive - - uses: actions/cache@v5 + - name: restore ccache + uses: actions/cache/restore@v5 + id: ccache-restore with: path: C:\Users\runneradmin\.ccache key: ccache-${{ runner.os }}-build-${{ github.sha }} @@ -72,12 +82,19 @@ jobs: - uses: msys2/setup-msys2@v2 with: update: true + cache: false install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-ccache mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-protobuf-c mingw-w64-x86_64-libusb mingw-w64-x86_64-unbound git - uses: ./.github/actions/set-make-job-count - name: build run: | ${{env.CCACHE_SETTINGS}} make release-static-win64 -j${{env.MAKE_JOB_COUNT}} + - name: save ccache + uses: actions/cache/save@v5 + if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true' + with: + path: C:\Users\runneradmin\.ccache + key: ${{ steps.ccache-restore.outputs.cache-primary-key }} build-arch: name: 'Arch Linux' @@ -86,17 +103,32 @@ jobs: image: archlinux:latest steps: - name: install dependencies - run: pacman -Syyu --noconfirm base-devel git cmake boost boost-libs openssl zeromq unbound libsodium readline expat gtest python3 doxygen graphviz hidapi libusb protobuf + run: pacman -Syyu --noconfirm base-devel git cmake boost boost-libs openssl zeromq unbound libsodium readline expat gtest python3 doxygen graphviz hidapi libusb protobuf ccache - name: configure git run: git config --global --add safe.directory '*' - uses: actions/checkout@v5 with: submodules: recursive + - name: restore ccache + uses: actions/cache/restore@v5 + id: ccache-restore + with: + path: ~/.cache/ccache + key: ccache-arch-build-${{ github.sha }} + restore-keys: ccache-arch-build- - uses: ./.github/actions/set-make-job-count - name: build env: CMAKE_BUILD_PARALLEL_LEVEL: ${{env.MAKE_JOB_COUNT}} - run: ${{env.BUILD_DEFAULT_LINUX}} + run: | + ${{ env.CCACHE_SETTINGS }} + ${{ env.BUILD_DEFAULT_LINUX }} + - name: save ccache + uses: actions/cache/save@v5 + if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true' + with: + path: ~/.cache/ccache + key: ${{ steps.ccache-restore.outputs.cache-primary-key }} build-debian: # Oldest supported Debian version @@ -118,11 +150,26 @@ jobs: - uses: actions/checkout@v5 with: submodules: recursive + - name: restore ccache + uses: actions/cache/restore@v5 + id: ccache-restore + with: + path: ~/.cache/ccache + key: ccache-debian-11-build-${{ github.sha }} + restore-keys: ccache-debian-11-build- - uses: ./.github/actions/set-make-job-count - name: build env: CMAKE_BUILD_PARALLEL_LEVEL: ${{env.MAKE_JOB_COUNT}} - run: ${{env.BUILD_DEFAULT_LINUX}} + run: | + ${{ env.CCACHE_SETTINGS }} + ${{ env.BUILD_DEFAULT_LINUX }} + - name: save ccache + uses: actions/cache/save@v5 + if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true' + with: + path: ~/.cache/ccache + key: ${{ steps.ccache-restore.outputs.cache-primary-key }} build-ubuntu: name: ${{ matrix.name }} @@ -131,10 +178,6 @@ jobs: fail-fast: false matrix: include: - # Oldest supported Ubuntu LTS version - - name: Ubuntu 20.04 - container: ubuntu:20.04 - # Most popular Ubuntu LTS version - name: Ubuntu 22.04 container: ubuntu:22.04 @@ -156,7 +199,9 @@ jobs: - uses: actions/checkout@v5 with: submodules: recursive - - uses: actions/cache@v5 + - name: restore ccache + uses: actions/cache/restore@v5 + id: ccache-restore with: path: ~/.ccache key: ccache-${{ matrix.container }}-build-${{ github.sha }} @@ -168,10 +213,15 @@ jobs: run: | ${{env.CCACHE_SETTINGS}} ${{env.BUILD_DEFAULT_LINUX}} + - name: save ccache + uses: actions/cache/save@v5 + if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true' + with: + path: ~/.ccache + key: ${{ steps.ccache-restore.outputs.cache-primary-key }} test-ubuntu: name: "${{ matrix.name }} (tests)" - needs: build-ubuntu runs-on: ubuntu-latest strategy: matrix: @@ -203,7 +253,9 @@ jobs: - uses: actions/checkout@v5 with: submodules: recursive - - uses: actions/cache@v5 + - name: restore ccache + uses: actions/cache/restore@v5 + id: ccache-restore with: path: ~/.ccache key: ccache-${{ matrix.container }}-build-${{ github.sha }} @@ -220,6 +272,12 @@ jobs: ${{env.CCACHE_SETTINGS}} ${{env.BUILD_DEFAULT_LINUX}} cmake --build build --target test + - name: save ccache + uses: actions/cache/save@v5 + if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true' + with: + path: ~/.ccache + key: ${{ steps.ccache-restore.outputs.cache-primary-key }} source-archive: name: "source archive" diff --git a/.github/workflows/depends.yml b/.github/workflows/depends.yml index 2be2a60e5..92345d831 100644 --- a/.github/workflows/depends.yml +++ b/.github/workflows/depends.yml @@ -73,28 +73,21 @@ jobs: fetch-depth: 0 submodules: recursive # Most volatile cache - - name: ccache - uses: actions/cache@v5 + - name: restore ccache + uses: actions/cache/restore@v5 + id: ccache-restore with: path: ~/.ccache key: ccache-${{ matrix.toolchain.host }}-${{ github.sha }} restore-keys: ccache-${{ matrix.toolchain.host }}- # Less volatile cache - - name: depends cache - uses: actions/cache@v5 + - name: restore depends cache + uses: actions/cache/restore@v5 + id: depends-restore with: path: contrib/depends/built key: depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }} - restore-keys: | - depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }} - depends-${{ matrix.toolchain.host }}- -# Static cache - - name: OSX SDK cache - uses: actions/cache@v5 - with: - path: contrib/depends/sdk-sources - key: sdk-${{ matrix.toolchain.host }}-${{ matrix.toolchain.osx_sdk }} - restore-keys: sdk-${{ matrix.toolchain.host }}-${{ matrix.toolchain.osx_sdk }} + restore-keys: depends-${{ matrix.toolchain.host }}- - name: prepare w64-mingw32 if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' || matrix.toolchain.host == 'i686-w64-mingw32' }} run: | @@ -104,6 +97,18 @@ jobs: run: | ${{env.CCACHE_SETTINGS}} make depends target=${{ matrix.toolchain.host }} -j4 + - name: save ccache + uses: actions/cache/save@v5 + if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true' + with: + path: ~/.ccache + key: ${{ steps.ccache-restore.outputs.cache-primary-key }} + - name: save depends cache + uses: actions/cache/save@v5 + if: github.event_name != 'pull_request' && steps.depends-restore.outputs.cache-hit != 'true' + with: + path: contrib/depends/built + key: ${{ steps.depends-restore.outputs.cache-primary-key }} - uses: actions/upload-artifact@v7 if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' || matrix.toolchain.host == 'x86_64-apple-darwin11' || matrix.toolchain.host == 'x86_64-unknown-linux-gnu' }} with: |
