From c6f9e38dace11dd512ff7f9ed6245dbfba454329 Mon Sep 17 00:00:00 2001 From: akrem-chabchoub Date: Fri, 29 May 2026 12:42:47 +0200 Subject: [PATCH 1/3] refactor: update ci workflows to speed it up --- .github/workflows/beekeeper.yml | 101 ++++++++++++++++++++++---------- .github/workflows/go.yml | 58 +++++++++--------- 2 files changed, 102 insertions(+), 57 deletions(-) diff --git a/.github/workflows/beekeeper.yml b/.github/workflows/beekeeper.yml index 0cb7c41fe2f..8dae2ec650e 100644 --- a/.github/workflows/beekeeper.yml +++ b/.github/workflows/beekeeper.yml @@ -48,35 +48,71 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.client_payload.ref }} - - name: Setup Go - uses: actions/setup-go@v6 - with: - cache: false - go-version-file: go.mod - - name: Cache Go Modules - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - name: Get Commit Message id: commit run: | MSG=$(git log --format=%s -n 1 ${{github.event.after}}) echo "msg=${MSG}" >> $GITHUB_OUTPUT - - name: Build - 0 - run: | - make binary - mv dist/bee bee-0 - - name: Apply patches and build - 1 + + build-bee: + name: Build bee binaries + runs-on: ubuntu-latest + needs: [init] + strategy: + matrix: + include: + - variant: "0" + patched: false + - variant: "1" + patched: true + steps: + - name: Checkout + uses: actions/checkout@v5 + if: github.event.action != 'beekeeper' + with: + fetch-depth: 0 + - name: Checkout + uses: actions/checkout@v5 + if: github.event.action == 'beekeeper' + with: + fetch-depth: 0 + ref: ${{ github.event.client_payload.ref }} + - name: Setup Go + uses: actions/setup-go@v6 + with: + cache: true + go-version-file: go.mod + - name: Apply patches + if: matrix.patched run: | patch pkg/api/postage.go .github/patches/postage_api.patch patch pkg/retrieval/retrieval.go .github/patches/retrieval.patch + - name: Build + run: | make binary - mv dist/bee bee-1 + mv dist/bee bee-${{ matrix.variant }} + - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 + with: + name: bee-${{ matrix.variant }} + path: bee-${{ matrix.variant }} + retention-days: 5 + + install-beekeeper: + name: Install beekeeper + runs-on: ubuntu-latest + needs: [init] + steps: + - name: Checkout + uses: actions/checkout@v5 + if: github.event.action != 'beekeeper' + with: + fetch-depth: 0 + - name: Checkout + uses: actions/checkout@v5 + if: github.event.action == 'beekeeper' + with: + fetch-depth: 0 + ref: ${{ github.event.client_payload.ref }} - name: Install beekeeper run: | export PATH=$(pwd):$PATH @@ -86,14 +122,11 @@ jobs: mv ~/.beekeeper/local.yaml local.yaml - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 with: - name: temp-artifacts + name: beekeeper-artifacts include-hidden-files: true path: | Dockerfile.goreleaser Makefile - bee-0 - bee-1 - bee-2 beekeeper local.yaml .beekeeper.yaml @@ -102,18 +135,22 @@ jobs: beekeeper: name: Integration tests runs-on: ubuntu-latest - needs: [init] + needs: [build-bee, install-beekeeper] steps: - - name: Cache + - name: Cache k3s uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 with: path: | /tmp/k3s-${{ env.K3S_VERSION }} key: k3s-${{ env.K3S_VERSION }} - - name: "Download Artifact" + - name: Download beekeeper artifacts + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + name: beekeeper-artifacts + - name: Download bee-1 uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: - name: temp-artifacts + name: bee-1 - name: Unpack artifacts run: | chmod +x bee-1 beekeeper .github/bin/beekeeper_artifacts.sh @@ -232,10 +269,14 @@ jobs: needs: [beekeeper] runs-on: ubuntu-latest steps: - - name: "Download Artifact" + - name: Download bee-0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + name: bee-0 + - name: Download beekeeper artifacts uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: - name: temp-artifacts + name: beekeeper-artifacts - name: Unpack artifacts run: | chmod +x bee-0 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 51afeff511a..a3acbe38bab 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,11 +20,12 @@ on: jobs: test: - name: Test - runs-on: ${{ matrix.os }} + name: Test (Linux, shard ${{ matrix.shard }}) + runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + shard: [0, 1, 2, 3] steps: - name: Checkout uses: actions/checkout@v5 @@ -33,23 +34,36 @@ jobs: with: cache: true go-version-file: go.mod - - name: Increase UDP buffer sizes (Ubuntu) - if: matrix.os == 'ubuntu-latest' + - name: Increase UDP buffer sizes run: | sudo sysctl -w net.core.rmem_max=7500000 sudo sysctl -w net.core.wmem_max=7500000 + - name: Test shard with race detector + run: | + PKGS=$(go list ./... | awk 'NR % 4 == ${{ matrix.shard }}' | tr '\n' ' ') + go test -race -failfast $PKGS + + test-compat: + name: Build check (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest] + steps: + - name: Checkout + uses: actions/checkout@v5 + - name: Setup Go + uses: actions/setup-go@v6 + with: + cache: true + go-version-file: go.mod - name: Increase UDP buffer sizes (macOS) if: matrix.os == 'macos-latest' - run: | - sudo sysctl -w kern.ipc.maxsockbuf=6291456 + run: sudo sysctl -w kern.ipc.maxsockbuf=6291456 - name: Build run: make build - - name: Test with race detector (Ubuntu and MacOS) - if: matrix.os != 'windows-latest' - run: make test-ci-race - - name: Test without race detector (Windows) - if: matrix.os == 'windows-latest' - run: make test-ci + lint: name: Lint runs-on: ubuntu-latest @@ -77,6 +91,7 @@ jobs: run: make check-whitespace - name: go mod tidy check uses: katexochen/go-tidy-check@v2 + coverage: name: Coverage Report if: github.ref == 'refs/heads/master' @@ -87,15 +102,8 @@ jobs: - name: Setup Go uses: actions/setup-go@v6 with: - cache: false + cache: true go-version-file: go.mod - - name: Cache Go Modules - uses: actions/cache@v4 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-coverage-${{ hashFiles('**/go.sum') }} - name: Test with code coverage run: make cover=1 test-ci - name: Upload coverage to Codecov @@ -104,21 +112,17 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true files: ./cover.out + trigger-beekeeper: name: Trigger Beekeeper runs-on: ubuntu-latest - needs: [test, lint, coverage] + needs: [test, lint] if: github.ref == 'refs/heads/master' steps: - name: Checkout uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Setup Go - uses: actions/setup-go@v6 - with: - cache: false - go-version-file: go.mod - name: Trigger Beekeeper uses: peter-evans/repository-dispatch@v2 with: From 3be9601425c216a2c7426d1c10d836beb1ebb400 Mon Sep 17 00:00:00 2001 From: akrem-chabchoub Date: Wed, 8 Jul 2026 14:24:53 +0200 Subject: [PATCH 2/3] chore: update workflows for caching and concurrency management --- .github/workflows/beekeeper.yml | 165 ++++++++++++++++---------------- .github/workflows/codeql.yml | 42 ++++---- .github/workflows/docs.yaml | 29 +----- .github/workflows/go.yml | 19 +++- 4 files changed, 122 insertions(+), 133 deletions(-) diff --git a/.github/workflows/beekeeper.yml b/.github/workflows/beekeeper.yml index 7fc34713754..b26b6c003f9 100644 --- a/.github/workflows/beekeeper.yml +++ b/.github/workflows/beekeeper.yml @@ -30,6 +30,11 @@ env: AWS_EC2_METADATA_DISABLED: true AWS_ENDPOINT: fra1.digitaloceanspaces.com VERTAG: ${GITHUB_RUN_ID} + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: init: name: Init @@ -57,7 +62,6 @@ jobs: build-bee: name: Build bee binaries runs-on: ubuntu-latest - needs: [init] strategy: matrix: include: @@ -80,8 +84,17 @@ jobs: - name: Setup Go uses: actions/setup-go@v6 with: - cache: true + cache: false go-version-file: go.mod + - name: Cache Go build cache (binary) + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-binary-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-binary- - name: Apply patches if: matrix.patched run: | @@ -100,7 +113,6 @@ jobs: install-beekeeper: name: Install beekeeper runs-on: ubuntu-latest - needs: [init] steps: - name: Checkout uses: actions/checkout@v5 @@ -133,9 +145,40 @@ jobs: .github/bin/beekeeper_artifacts.sh retention-days: 5 beekeeper: - name: Integration tests + name: Integration tests (${{ matrix.shard }}) runs-on: ubuntu-latest - needs: [build-bee, install-beekeeper] + needs: [init, build-bee, install-beekeeper] + timeout-minutes: 40 + env: + VERTAG: ${GITHUB_RUN_ID}-${{ matrix.shard }} + strategy: + fail-fast: false + matrix: + include: + - shard: chain + checks: >- + ci-pingpong + ci-full-connectivity + ci-settlements + ci-manifest + ci-manifest-v1 + ci-postage + ci-stake + ci-withdraw + ci-act + - shard: data + checks: >- + ci-pingpong + ci-full-connectivity + ci-pss + ci-soc + ci-gsoc + ci-pushsync-chunks + ci-pushsync-light-chunks + ci-retrieval + ci-redundancy + ci-feed-v1 + ci-feed steps: - name: Cache k3s uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 @@ -168,99 +211,53 @@ jobs: - name: Set local cluster run: | timeout ${TIMEOUT} make deploylocal BEEKEEPER_CLUSTER=local-dns - - name: Test pingpong - id: pingpong - run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-pingpong; do echo "waiting for pingpong..."; sleep .3; done' - - name: Test fullconnectivity - id: fullconnectivity - run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks=ci-full-connectivity; do echo "waiting for full connectivity..."; sleep .3; done' - - name: Test settlements - id: settlements - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-settlements - - name: Sleep for time allowance to replenish - run: sleep 2 - - name: Test pss - id: pss - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-pss - - name: Test soc - id: soc - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-soc - - name: Test gsoc - id: gsoc - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-gsoc - - name: Test pushsync (chunks) - id: pushsync-chunks-1 - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-pushsync-chunks - - name: Test pushsync (light mode chunks) - id: pushsync-chunks-2 - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-pushsync-light-chunks - - name: Test retrieval - id: retrieval - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-retrieval - - name: Test manifest - id: manifest - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-manifest - - name: Test manifest v1 - id: manifest-v1 - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-manifest-v1 - - name: Test postage stamps - id: postage-stamps - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-postage - - name: Test staking - id: stake - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-stake - - name: Test withdraw - id: withdraw - run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-withdraw; do echo "waiting for withdraw..."; sleep .3; done' - - name: Test redundancy - id: redundancy - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-redundancy - - name: Test act - id: act - run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-act; do echo "waiting for act..."; sleep .3; done' - - name: Test feeds v1 - id: feeds-v1 - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-feed-v1 - - name: Test feeds - id: feeds - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-feed + - name: Run checks (${{ matrix.shard }}) + run: | + RETRY_CHECKS="ci-pingpong ci-full-connectivity ci-withdraw ci-act" + run_check() { + if [[ " ${RETRY_CHECKS} " == *" $1 "* ]]; then + timeout ${TIMEOUT} bash -c "until beekeeper check --cluster-name local-dns --checks $1; do echo \"waiting for $1...\"; sleep .3; done" + else + timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks "$1" + fi + } + for check in ${{ matrix.checks }}; do + echo "::group::${check}" + if ! run_check "${check}"; then + echo "FAILED=${check}" >> $GITHUB_ENV + echo "::endgroup::" + echo "::error::beekeeper check ${check} failed" + exit 1 + fi + echo "::endgroup::" + if [ "${check}" = "ci-settlements" ]; then + sleep 2 + fi + done - name: Collect debug artifacts if: failure() + env: + HEAD_REF: ${{ github.head_ref }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} run: | bash .github/bin/beekeeper_artifacts.sh local-dns - export FAILED='no-test' - if ${{ steps.pingpong.outcome=='failure' }}; then FAILED=pingpong; fi - if ${{ steps.fullconnectivity.outcome=='failure' }}; then FAILED=fullconnectivity; fi - if ${{ steps.settlements.outcome=='failure' }}; then FAILED=settlements; fi - if ${{ steps.pss.outcome=='failure' }}; then FAILED=pss; fi - if ${{ steps.soc.outcome=='failure' }}; then FAILED=soc; fi - if ${{ steps.gsoc.outcome=='failure' }}; then FAILED=gsoc; fi - if ${{ steps.pushsync-chunks-1.outcome=='failure' }}; then FAILED=pushsync-chunks-1; fi - if ${{ steps.pushsync-chunks-2.outcome=='failure' }}; then FAILED=pushsync-chunks-2; fi - if ${{ steps.retrieval.outcome=='failure' }}; then FAILED=retrieval; fi - if ${{ steps.manifest.outcome=='failure' }}; then FAILED=manifest; fi - if ${{ steps.manifest-v1.outcome=='failure' }}; then FAILED=manifest-v1; fi - if ${{ steps.postage-stamps.outcome=='failure' }}; then FAILED=postage-stamps; fi - if ${{ steps.stake.outcome=='failure' }}; then FAILED=stake; fi - if ${{ steps.withdraw.outcome=='failure' }}; then FAILED=withdraw; fi - if ${{ steps.redundancy.outcome=='failure' }}; then FAILED=redundancy; fi - if ${{ steps.feeds.outcome=='failure' }}; then FAILED=feeds; fi - if ${{ steps.feeds-v1.outcome=='failure' }}; then FAILED=feeds-v1; fi - if ${{ steps.act.outcome=='failure' }}; then FAILED=act; fi - curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**${RUN_TYPE}** Beekeeper Error\nBranch: \`${{ github.head_ref }}\`\nUser: @${{ github.event.pull_request.user.login }}\nDebugging artifacts: [click](https://$BUCKET_NAME.$AWS_ENDPOINT/artifacts_$VERTAG.tar.gz)\nStep failed: \`${FAILED}\`\"}" https://beehive.ethswarm.org/hooks/${{ secrets.TUNSHELL_KEY }} - echo "Failed test: ${FAILED}" + curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**${RUN_TYPE}** Beekeeper Error (shard ${{ matrix.shard }})\nBranch: \`${HEAD_REF}\`\nUser: @${PR_AUTHOR}\nDebugging artifacts: [click](https://$BUCKET_NAME.$AWS_ENDPOINT/artifacts_$VERTAG.tar.gz)\nStep failed: \`${FAILED:-no-test}\`\"}" https://beehive.ethswarm.org/hooks/${{ secrets.TUNSHELL_KEY }} + echo "Failed test: ${FAILED:-no-test}" - name: Create tunshell session for debug if: failure() && contains(needs.init.outputs.msg, '[debug]') + env: + HEAD_REF: ${{ github.head_ref }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} run: | KEYS=$(curl -sSf -X POST https://eu.relay.tunshell.com/api/sessions) - curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**Integration tests** Beekeeper Debug\nBranch: \`${{ github.head_ref }}\`\nUser: @${{ github.event.pull_request.user.login }}\nDebug shell: \`sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} eu.relay.tunshell.com\`\"}" https://beehive.ethswarm.org/hooks/${{ secrets.TUNSHELL_KEY }} + curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**Integration tests** Beekeeper Debug (shard ${{ matrix.shard }})\nBranch: \`${HEAD_REF}\`\nUser: @${PR_AUTHOR}\nDebug shell: \`sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} eu.relay.tunshell.com\`\"}" https://beehive.ethswarm.org/hooks/${{ secrets.TUNSHELL_KEY }} echo "Connect to github actions node using" echo "sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} eu.relay.tunshell.com" curl -sSf https://lets.tunshell.com/init.sh | sh /dev/stdin T $(echo $KEYS | jq -r .peer1_key) ${{ secrets.TUNSHELL_SECRET }} eu.relay.tunshell.com - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 if: failure() with: - name: debug-dump + name: debug-dump-${{ matrix.shard }} path: dump/ retag: name: Retag and Trigger ArgoCD diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 38402e52cda..89c4ebf5068 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,14 +1,3 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# name: "CodeQL" permissions: read-all on: @@ -20,10 +9,15 @@ on: schedule: - cron: '23 1 * * 2' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: analyze: name: Analyze runs-on: ubuntu-latest + timeout-minutes: 30 permissions: actions: read contents: read @@ -34,14 +28,25 @@ jobs: matrix: language: [ 'go' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Use only 'java' to analyze code written in Java, Kotlin or both - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Setup Go + uses: actions/setup-go@v6 + with: + cache: false + go-version-file: go.mod + - name: Cache Go modules + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-codeql-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-codeql- + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3 @@ -54,22 +59,11 @@ jobs: # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@v3 - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index fb41df6f301..1079bf85f8a 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -4,40 +4,21 @@ on: push: branches: - 'master' + paths: + - 'openapi/**' pull_request: - branches: - - '**' + paths: + - 'openapi/**' jobs: build: name: Preview runs-on: ubuntu-latest + timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v5 - with: - fetch-depth: '0' - - name: Check whether docs have changed - id: checkdocs - run: | - changed=false - git diff --name-only HEAD^ HEAD > files.txt - while IFS= read -r file - do - if [[ $file == openapi/* ]]; then - echo "detected openapi spec change" - changed=true - fi - done < files.txt - - if [ $changed == true ] - then - echo "::set-output name=build_docs::true" - else - echo "::set-output name=build_docs::false" - fi - name: Build the OpenAPI specs - if: steps.checkdocs.outputs.build_docs == 'true' uses: acud/openapi-dockerized@v1 with: build-roots: 'openapi/Swarm.yaml' diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 483e0ec5971..3b8e4b67996 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -18,10 +18,15 @@ on: branches: - '**' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: test: name: Test (Linux, shard ${{ matrix.shard }}) runs-on: ubuntu-latest + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -32,8 +37,17 @@ jobs: - name: Setup Go uses: actions/setup-go@v6 with: - cache: true + cache: false go-version-file: go.mod + - name: Cache Go build cache (per shard) + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-test-shard${{ matrix.shard }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-test-shard${{ matrix.shard }}- - name: Increase UDP buffer sizes run: | sudo sysctl -w net.core.rmem_max=7500000 @@ -46,6 +60,7 @@ jobs: test-compat: name: Build check (${{ matrix.os }}) runs-on: ${{ matrix.os }} + timeout-minutes: 25 strategy: fail-fast: false matrix: @@ -67,6 +82,7 @@ jobs: lint: name: Lint runs-on: ubuntu-latest + timeout-minutes: 20 steps: - name: Checkout uses: actions/checkout@v5 @@ -99,6 +115,7 @@ jobs: name: Coverage Report if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest + timeout-minutes: 40 steps: - name: Checkout uses: actions/checkout@v5 From 1d83747e2e437b3bac2adc91b58afd0aa5427a79 Mon Sep 17 00:00:00 2001 From: akrem-chabchoub Date: Thu, 9 Jul 2026 12:27:11 +0200 Subject: [PATCH 3/3] chore: trigger ci