From 8887a121b43d36c41e6c9da799805d54eaf2b2b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 17 Jul 2021 10:08:47 +0100 Subject: [PATCH 1/9] First attempt at a condition expression in `concurrency.group` --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1c8822d93..b1052980f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,7 +3,7 @@ on: push concurrency: # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers. - group: ci-${{ github.ref }} + group: github.ref == 'refs/heads/master' && 'ci-${{ github.sha }}' || 'ci-${{ github.ref }}' cancel-in-progress: true jobs: build: From 0d2ddd8b7024251511cbbc3b5370356f1193a01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 17 Jul 2021 10:09:01 +0100 Subject: [PATCH 2/9] Flip to be able to test on PR --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b1052980f..69e9efaac 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,7 +3,7 @@ on: push concurrency: # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers. - group: github.ref == 'refs/heads/master' && 'ci-${{ github.sha }}' || 'ci-${{ github.ref }}' + group: github.ref != 'refs/heads/master' && 'ci-${{ github.sha }}' || 'ci-${{ github.ref }}' cancel-in-progress: true jobs: build: From 40851d75e7d0fe79fd3f9ab4ceb4aa8b10066d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 17 Jul 2021 10:14:39 +0100 Subject: [PATCH 3/9] Use explicit branch --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 69e9efaac..535c14b23 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,7 +3,7 @@ on: push concurrency: # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers. - group: github.ref != 'refs/heads/master' && 'ci-${{ github.sha }}' || 'ci-${{ github.ref }}' + group: github.ref == 'refs/heads/canceltest' && 'ci-${{ github.sha }}' || 'ci-${{ github.ref }}' cancel-in-progress: true jobs: build: From 3f27b14936999000fe9f31398f2caf0a2a37756a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 17 Jul 2021 10:28:58 +0100 Subject: [PATCH 4/9] Change comment --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 535c14b23..feae40c3f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,7 +2,8 @@ name: CI # Check Gradle and AGP combinations on: push concurrency: - # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers. + # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}. + # On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke. group: github.ref == 'refs/heads/canceltest' && 'ci-${{ github.sha }}' || 'ci-${{ github.ref }}' cancel-in-progress: true jobs: From b5248e44bcbd8f0dd2684eeca0cfca9a15857866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 17 Jul 2021 10:30:12 +0100 Subject: [PATCH 5/9] Change comment2 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index feae40c3f..d20b3f0ce 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,7 +2,7 @@ name: CI # Check Gradle and AGP combinations on: push concurrency: - # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}. + # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.1 # On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke. group: github.ref == 'refs/heads/canceltest' && 'ci-${{ github.sha }}' || 'ci-${{ github.ref }}' cancel-in-progress: true From cef11a0bffee950daa71093deb223c78da0cabc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 17 Jul 2021 10:57:55 +0100 Subject: [PATCH 6/9] Use expression wrapper and format2 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d20b3f0ce..0185b9d48 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -4,7 +4,7 @@ on: concurrency: # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.1 # On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke. - group: github.ref == 'refs/heads/canceltest' && 'ci-${{ github.sha }}' || 'ci-${{ github.ref }}' + group: ${{ github.ref == 'refs/heads/canceltest' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }} cancel-in-progress: true jobs: build: From 0106286c58232e3af9756d584cedee484d15d994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 17 Jul 2021 11:14:28 +0100 Subject: [PATCH 7/9] Use expression wrapper and format2 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0185b9d48..bc25cd494 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,7 +2,7 @@ name: CI # Check Gradle and AGP combinations on: push concurrency: - # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.1 + # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}. # On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke. group: ${{ github.ref == 'refs/heads/canceltest' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }} cancel-in-progress: true From e752932358b656f267e7edc50211b77ccf2e57da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 17 Jul 2021 16:44:55 +0100 Subject: [PATCH 8/9] Final --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bc25cd494..467156ce3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -4,7 +4,7 @@ on: concurrency: # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}. # On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke. - group: ${{ github.ref == 'refs/heads/canceltest' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }} + group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }} cancel-in-progress: true jobs: build: From a8b8663c95e7e4a04299b5b8bc89bcc4c2248e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 17 Jul 2021 16:53:49 +0100 Subject: [PATCH 9/9] Comment --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 467156ce3..4822f3ee5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -4,6 +4,7 @@ on: concurrency: # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}. # On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke. + # More info: https://stackoverflow.com/a/68422069/253468: group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }} cancel-in-progress: true jobs: