From 0181c86283622ffc00c462ae53e5af7ed8364a72 Mon Sep 17 00:00:00 2001 From: snider Date: Mon, 6 Oct 2025 22:02:27 +0100 Subject: [PATCH] Enhance CI workflows by adding caching steps for various platforms and enabling lookup-only mode for improved efficiency --- .github/workflows/_on-pr.yml | 1 + .github/workflows/_on-push.yml | 1 + .github/workflows/build-linux-arm64.yml | 37 ++++++++++++++++++++ .github/workflows/build-linux-intel.yml | 38 +++++++++++++++++++++ .github/workflows/build-macos-arm64.yml | 41 +++++++++++++++++++---- .github/workflows/build-macos-intel.yml | 33 ++++++++++++++++++ .github/workflows/build-windows-intel.yml | 13 +++---- 7 files changed, 152 insertions(+), 12 deletions(-) diff --git a/.github/workflows/_on-pr.yml b/.github/workflows/_on-pr.yml index 0d7aca87..dd05b7cb 100644 --- a/.github/workflows/_on-pr.yml +++ b/.github/workflows/_on-pr.yml @@ -7,6 +7,7 @@ on: pull_request_review: pull_request: types: + - ready_for_review - review_requested - closed diff --git a/.github/workflows/_on-push.yml b/.github/workflows/_on-push.yml index 38d9fb4c..4c090e81 100644 --- a/.github/workflows/_on-push.yml +++ b/.github/workflows/_on-push.yml @@ -9,6 +9,7 @@ on: branches: - 'dev' - 'main' + - 'dev-*' concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/build-linux-arm64.yml b/.github/workflows/build-linux-arm64.yml index 5eb0b128..09a49d3d 100644 --- a/.github/workflows/build-linux-arm64.yml +++ b/.github/workflows/build-linux-arm64.yml @@ -11,8 +11,45 @@ on: type: string jobs: + cache: + name: gcc-linux-arm64 + runs-on: ubuntu-22.04-arm + steps: + - name: Cache SDK Folder + id: cache + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/build/sdk + ${{ github.workspace }}/build/bin + key: ${{ runner.os }}-${{ runner.arch }}-sdk + + - name: Checkout Project + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + submodules: recursive + + - name: install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: sudo apt-get install -y autotools-dev git build-essential libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev pngquant + + - uses: actions/setup-python@v5 + if: steps.cache.outputs.cache-hit != 'true' + with: + python-version: 3.x + + - if: steps.cache.outputs.cache-hit != 'true' + run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]" + + - name: Compile Release + if: steps.cache.outputs.cache-hit != 'true' + run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + build: name: gcc-linux-arm64 + needs: cache runs-on: ubuntu-22.04-arm steps: - name: Checkout Project diff --git a/.github/workflows/build-linux-intel.yml b/.github/workflows/build-linux-intel.yml index cd9a6cd2..b145a16d 100644 --- a/.github/workflows/build-linux-intel.yml +++ b/.github/workflows/build-linux-intel.yml @@ -11,8 +11,46 @@ on: type: string jobs: + cache: + name: gcc-linux-x86_64 + runs-on: ubuntu-22.04 + steps: + - name: Cache SDK Folder + id: cache + uses: actions/cache@v4 + with: + lookup-only: true + path: | + ${{ github.workspace }}/build/sdk + ${{ github.workspace }}/build/bin + key: ${{ runner.os }}-${{ runner.arch }}-sdk + + - name: Checkout Project + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + submodules: recursive + + - name: install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: sudo apt-get install -y autotools-dev git build-essential + + - uses: actions/setup-python@v5 + if: steps.cache.outputs.cache-hit != 'true' + with: + python-version: 3.x + - if: steps.cache.outputs.cache-hit != 'true' + run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]" + + - name: Compile Release + if: steps.cache.outputs.cache-hit != 'true' + run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + + build: name: gcc-linux-x86_64 + needs: cache runs-on: ubuntu-22.04 steps: - name: Checkout Project diff --git a/.github/workflows/build-macos-arm64.yml b/.github/workflows/build-macos-arm64.yml index 4771151a..b185df6e 100644 --- a/.github/workflows/build-macos-arm64.yml +++ b/.github/workflows/build-macos-arm64.yml @@ -12,9 +12,43 @@ on: jobs: - build-cli: + cache: name: apple-clang-armv8 runs-on: macos-15 + steps: + - name: Cache SDK Folder + id: cache + uses: actions/cache@v4 + with: + lookup-only: true + path: | + ${{ github.workspace }}/build/sdk + ${{ github.workspace }}/build/bin + key: ${{ runner.os }}-${{ runner.arch }}-sdk + + - name: Checkout Project + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + submodules: recursive + + - uses: actions/setup-python@v5 + if: steps.cache.outputs.cache-hit != 'true' + with: + python-version: 3.x + + - if: steps.cache.outputs.cache-hit != 'true' + run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]" + + - name: Compile Release + if: steps.cache.outputs.cache-hit != 'true' + run: make build-deps CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + + build: + name: apple-clang-armv8 + needs: cache + runs-on: macos-15 steps: - name: Checkout Project uses: actions/checkout@v4.2.2 @@ -22,7 +56,6 @@ jobs: fetch-depth: 0 submodules: recursive - - name: Cache SDK Folder uses: actions/cache@v4 with: @@ -37,13 +70,9 @@ jobs: - run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]" -# - name: Compile Release -# run: make apple-clang-armv8 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} - - name: Compile Release run: make release CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} - - name: CLI Artifacts uses: ./.github/actions/upload-artifacts with: diff --git a/.github/workflows/build-macos-intel.yml b/.github/workflows/build-macos-intel.yml index acd14ed1..046ee04a 100644 --- a/.github/workflows/build-macos-intel.yml +++ b/.github/workflows/build-macos-intel.yml @@ -11,8 +11,41 @@ on: type: string jobs: + cache: + name: apple-clang-x86_64 + runs-on: macos-13 + steps: + - name: Cache SDK Folder + id: cache + uses: actions/cache@v4 + with: + lookup-only: true + path: | + ${{ github.workspace }}/build/sdk + ${{ github.workspace }}/build/bin + key: ${{ runner.os }}-${{ runner.arch }}-sdk + + - name: Checkout Project + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + submodules: recursive + + - uses: actions/setup-python@v5 + if: steps.cache.outputs.cache-hit != 'true' + with: + python-version: 3.x + - if: steps.cache.outputs.cache-hit != 'true' + run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]" + + - name: Compile Release + if: steps.cache.outputs.cache-hit != 'true' + run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + build: name: apple-clang-x86_64 + needs: cache runs-on: macos-13 steps: - name: Checkout Project diff --git a/.github/workflows/build-windows-intel.yml b/.github/workflows/build-windows-intel.yml index cf0b7769..d5cc6da3 100644 --- a/.github/workflows/build-windows-intel.yml +++ b/.github/workflows/build-windows-intel.yml @@ -15,12 +15,6 @@ jobs: name: cache-msvc-194-x86_64 runs-on: windows-latest steps: - - name: Checkout Project - uses: actions/checkout@v4.2.2 - with: - fetch-depth: 0 - submodules: recursive - - name: Cache SDK Folder id: cache uses: actions/cache@v4 @@ -31,6 +25,13 @@ jobs: ${{ github.workspace }}/build/bin key: ${{ runner.os }}-${{ runner.arch }}-sdk + - name: Checkout Project + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + submodules: recursive + - uses: actions/setup-python@v5 if: steps.cache.outputs.cache-hit != 'true' with: