From 1d4ed20c2f47994cba88432de2c5a5ea3c1db58e Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Fri, 10 Nov 2023 15:58:30 +0100 Subject: [PATCH 1/3] Add conditions to all CI jobs to only run on main repo by default This is a follow-up to gh-4271. At the moment, when a contributor pushes the latest `develop` to their own branch to bring their own fork in sync with `main`, or if they push another branch, this triggers 30 CI jobs to run. Most will complete silently and only burn CPU time unnecessarily. If there's a failure, this may result in unexpected failure notifications. And the AWS Graviton3 run won't complete at all and time out, since the Cirun hook will only work when triggered from the main repo. --- .github/workflows/arm64_graviton.yml | 1 + .github/workflows/c910v.yml | 1 + .github/workflows/dynamic_arch.yml | 3 +++ .github/workflows/loongarch64.yml | 1 + .github/workflows/mips64.yml | 1 + 5 files changed, 7 insertions(+) diff --git a/.github/workflows/arm64_graviton.yml b/.github/workflows/arm64_graviton.yml index bcb05047c..9dd0ae589 100644 --- a/.github/workflows/arm64_graviton.yml +++ b/.github/workflows/arm64_graviton.yml @@ -7,6 +7,7 @@ permissions: jobs: build: + if: "github.repository == 'OpenMathLib/OpenBLAS'" runs-on: "cirun-aws-runner-graviton--${{ github.run_id }}" strategy: diff --git a/.github/workflows/c910v.yml b/.github/workflows/c910v.yml index 199304fb1..e6ed08f2c 100644 --- a/.github/workflows/c910v.yml +++ b/.github/workflows/c910v.yml @@ -7,6 +7,7 @@ permissions: jobs: TEST: + if: "github.repository == 'OpenMathLib/OpenBLAS'" runs-on: ubuntu-latest env: xuetie_toolchain: https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1663142514282 diff --git a/.github/workflows/dynamic_arch.yml b/.github/workflows/dynamic_arch.yml index 0c39bfddf..02429e317 100644 --- a/.github/workflows/dynamic_arch.yml +++ b/.github/workflows/dynamic_arch.yml @@ -7,6 +7,7 @@ permissions: jobs: build: + if: "github.repository == 'OpenMathLib/OpenBLAS'" runs-on: ${{ matrix.os }} strategy: @@ -146,6 +147,7 @@ jobs: msys2: + if: "github.repository == 'OpenMathLib/OpenBLAS'" runs-on: windows-latest strategy: @@ -312,6 +314,7 @@ jobs: cross_build: + if: "github.repository == 'OpenMathLib/OpenBLAS'" runs-on: ubuntu-22.04 strategy: diff --git a/.github/workflows/loongarch64.yml b/.github/workflows/loongarch64.yml index e0236ca86..fa62d0b41 100644 --- a/.github/workflows/loongarch64.yml +++ b/.github/workflows/loongarch64.yml @@ -4,6 +4,7 @@ on: [push, pull_request] jobs: TEST: + if: "github.repository == 'OpenMathLib/OpenBLAS'" runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/.github/workflows/mips64.yml b/.github/workflows/mips64.yml index de7c0c0f3..7f09d4fca 100644 --- a/.github/workflows/mips64.yml +++ b/.github/workflows/mips64.yml @@ -7,6 +7,7 @@ permissions: jobs: TEST: + if: "github.repository == 'OpenMathLib/OpenBLAS'" runs-on: ubuntu-latest strategy: fail-fast: false From 2418a20f1fb89783dc1e198fd0e2bd78ecf43e77 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Fri, 10 Nov 2023 16:05:52 +0100 Subject: [PATCH 2/3] Cancel running CI jobs when new changes are pushed to a PR The `group` expression ensures that the cancel-in-progress behavior is to only cancel if a new commit is pushed to the PR for which the job is running, not other PRs. This is a fairly standard snippet, used also in CI jobs for NumPy and other projects. --- .github/workflows/arm64_graviton.yml | 4 ++++ .github/workflows/c910v.yml | 4 ++++ .github/workflows/dynamic_arch.yml | 4 ++++ .github/workflows/loongarch64.yml | 4 ++++ .github/workflows/mips64.yml | 4 ++++ .github/workflows/nightly-Homebrew-build.yml | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/.github/workflows/arm64_graviton.yml b/.github/workflows/arm64_graviton.yml index 9dd0ae589..4382510df 100644 --- a/.github/workflows/arm64_graviton.yml +++ b/.github/workflows/arm64_graviton.yml @@ -2,6 +2,10 @@ name: arm64 graviton cirun on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + permissions: contents: read # to fetch code (actions/checkout) diff --git a/.github/workflows/c910v.yml b/.github/workflows/c910v.yml index e6ed08f2c..30cf32b34 100644 --- a/.github/workflows/c910v.yml +++ b/.github/workflows/c910v.yml @@ -2,6 +2,10 @@ name: c910v qemu test on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + permissions: contents: read # to fetch code (actions/checkout) diff --git a/.github/workflows/dynamic_arch.yml b/.github/workflows/dynamic_arch.yml index 02429e317..49721958a 100644 --- a/.github/workflows/dynamic_arch.yml +++ b/.github/workflows/dynamic_arch.yml @@ -2,6 +2,10 @@ name: continuous build on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + permissions: contents: read # to fetch code (actions/checkout) diff --git a/.github/workflows/loongarch64.yml b/.github/workflows/loongarch64.yml index fa62d0b41..4a9bf98b6 100644 --- a/.github/workflows/loongarch64.yml +++ b/.github/workflows/loongarch64.yml @@ -2,6 +2,10 @@ name: loongarch64 qemu test on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: TEST: if: "github.repository == 'OpenMathLib/OpenBLAS'" diff --git a/.github/workflows/mips64.yml b/.github/workflows/mips64.yml index 7f09d4fca..4686ba713 100644 --- a/.github/workflows/mips64.yml +++ b/.github/workflows/mips64.yml @@ -2,6 +2,10 @@ name: mips64 qemu test on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + permissions: contents: read # to fetch code (actions/checkout) diff --git a/.github/workflows/nightly-Homebrew-build.yml b/.github/workflows/nightly-Homebrew-build.yml index eb315f1d4..ca57fba70 100644 --- a/.github/workflows/nightly-Homebrew-build.yml +++ b/.github/workflows/nightly-Homebrew-build.yml @@ -18,6 +18,10 @@ on: name: Nightly-Homebrew-Build +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + permissions: contents: read # to fetch code (actions/checkout) From 8613632dc53eebc505b56c38af5d46123e2704b3 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Fri, 10 Nov 2023 16:23:44 +0100 Subject: [PATCH 3/3] Trigger AWS Graviton 3 CI job only for develop and release branches --- .github/workflows/arm64_graviton.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/arm64_graviton.yml b/.github/workflows/arm64_graviton.yml index 4382510df..6928312b5 100644 --- a/.github/workflows/arm64_graviton.yml +++ b/.github/workflows/arm64_graviton.yml @@ -1,6 +1,14 @@ name: arm64 graviton cirun -on: [push, pull_request] +on: + push: + branches: + - develop + - release-** + pull_request: + branches: + - develop + - release-** concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}