]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ci: cancel running jobs on push
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 22 Jun 2023 10:33:12 +0000 (12:33 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 22 Jun 2023 10:38:53 +0000 (12:38 +0200)
Let's cancel already running GH Actions jobs when a PR is (force) pushed
to conserve resources and make the CI runs faster thanks to the freed up
queue.

.github/workflows/cibuild.yml
.github/workflows/cifuzz.yml

index 06f7d03b79a5743c15ce53118db228e213a3a5fb..f6da622cf54530e6979d037b060e77984eaac75b 100644 (file)
@@ -20,6 +20,9 @@ permissions:
 jobs:
   build:
     runs-on: ubuntu-latest
+    concurrency:
+      group: ${{ github.workflow }}-${{ toJSON(matrix.env) }}-${{ github.ref }}
+      cancel-in-progress: true
     strategy:
       fail-fast: false
       matrix:
@@ -45,13 +48,16 @@ jobs:
         run: sudo -E .github/workflows/cibuild.sh CHECK
       - name: Make install
         run: .github/workflows/cibuild.sh INSTALL
+
   coveralls:
     permissions:
       contents: read # to fetch code (actions/checkout)
       checks: write # to create new checks (coverallsapp/github-action)
-
     runs-on: ubuntu-latest
     if: github.repository == 'util-linux/util-linux'
+    concurrency:
+      group: ${{ github.workflow }}-coveralls-${{ github.ref }}
+      cancel-in-progress: true
     env:
       COMPILER: gcc
       COMPILER_VERSION: 10
@@ -71,9 +77,13 @@ jobs:
         with:
           github-token: ${{ secrets.GITHUB_TOKEN }}
           path-to-lcov: ./coverage.info
+
   meson:
     needs: build
     runs-on: ubuntu-latest
+    concurrency:
+      group: ${{ github.workflow }}-meson-${{ github.ref }}
+      cancel-in-progress: true
     env:
       COMPILER: gcc
       COMPILER_VERSION: 10
@@ -87,9 +97,13 @@ jobs:
         run: .github/workflows/cibuild.sh MESONCONF
       - name: Meson build
         run: .github/workflows/cibuild.sh MESONBUILD
+
   distcheck:
     needs: build
     runs-on: ubuntu-latest
+    concurrency:
+      group: ${{ github.workflow }}-distcheck-${{ github.ref }}
+      cancel-in-progress: true
     env:
       COMPILER: gcc
       COMPILER_VERSION: 10
@@ -104,6 +118,7 @@ jobs:
         run: .github/workflows/cibuild.sh CONFIGURE
       - name: Make distcheck
         run: .github/workflows/cibuild.sh DISTCHECK
+
   build-compat:
     strategy:
       fail-fast: false
@@ -112,6 +127,9 @@ jobs:
           - image: ubuntu:18.04
     name: build (compat, ${{ matrix.image }})
     runs-on: ubuntu-latest
+    concurrency:
+      group: ${{ github.workflow }}-build-compat-${{ github.ref }}
+      cancel-in-progress: true
     env:
       COMPILER: none
     container:
@@ -129,9 +147,13 @@ jobs:
         run: .github/workflows/cibuild.sh MAKE
       - name: Check
         run: .github/workflows/cibuild.sh CHECK
+
   build-arch:
     name: build (qemu-user, ${{ matrix.arch }})
     runs-on: ubuntu-latest
+    concurrency:
+      group: ${{ github.workflow }}-${{ toJSON(matrix) }}-${{ github.ref }}
+      cancel-in-progress: true
     strategy:
       fail-fast: false
       matrix:
@@ -159,9 +181,13 @@ jobs:
             .github/workflows/cibuild.sh CONFIGURE MAKE
             # Check
             .github/workflows/cibuild.sh CHECK
+
   build-openwrt:
     name: build (openwrt, ${{ matrix.target }})
     runs-on: ubuntu-latest
+    concurrency:
+      group: ${{ github.workflow }}-${{ toJSON(matrix) }}-${{ github.ref }}
+      cancel-in-progress: true
     strategy:
       fail-fast: false
       matrix:
index 944441a730f8f795ed72ed3d69711a4f8d47038a..25a8dd71cf850891476887ac8ea9a91fcee80f61 100644 (file)
@@ -23,6 +23,9 @@ jobs:
 
     runs-on: ubuntu-latest
     if: github.repository == 'util-linux/util-linux'
+    concurrency:
+      group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ matrix.architecture }}-${{ github.ref }}
+      cancel-in-progress: true
     strategy:
       fail-fast: false
       matrix: