From ccb315ada8f3af51a11e89179e1d2d14f0519890 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Wed, 23 Dec 2020 09:57:14 -0700 Subject: [PATCH 01/33] Remove push and pull request event triggers --- .github/workflows/upstream-dev-ci.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 629b1c27b05..58dd438537c 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -1,11 +1,5 @@ name: CI on: - push: - branches: - - master - pull_request: - branches: - - master schedule: - cron: "0 0 * * *" # Daily “At 00:00” UTC workflow_dispatch: # allows you to trigger the workflow run manually From 5f2a1ea01ef8ea90de9fa567f4af579862ca738e Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Wed, 23 Dec 2020 10:10:27 -0700 Subject: [PATCH 02/33] Remove `github.event_name` conditionals --- .github/workflows/upstream-dev-ci.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 58dd438537c..7a588526971 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -52,7 +52,6 @@ jobs: if: | failure() && steps.status.outcome == 'failure' - && github.event_name == 'schedule' && github.repository == 'pydata/xarray' uses: actions/upload-artifact@v2 with: @@ -65,7 +64,6 @@ jobs: needs: upstream-dev if: | always() - && github.event_name == 'schedule' && github.repository == 'pydata/xarray' && needs.upstream-dev.outputs.artifacts_availability == 'true' runs-on: ubuntu-latest From bd90d69f2196d2616d285526954c51bbf2229ece Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Wed, 23 Dec 2020 21:32:16 -0700 Subject: [PATCH 03/33] Enable running upstream-dev CI with special commit message --- .github/workflows/upstream-dev-ci.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 7a588526971..e67268c5857 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -1,5 +1,11 @@ name: CI on: + push: + branches: + - master + pull_request: + branches: + - master schedule: - cron: "0 0 * * *" # Daily “At 00:00” UTC workflow_dispatch: # allows you to trigger the workflow run manually @@ -8,7 +14,9 @@ jobs: upstream-dev: name: upstream-dev runs-on: ubuntu-latest - if: github.repository == 'pydata/xarray' + if: | + contains(github.event.head_commit.message, 'test-upstream') + || (github.repository == 'pydata/xarray' && github.event_name != 'pull_request') defaults: run: shell: bash -l {0} From 69ad82c3bd64888e863b6886ceb4f14d154d7568 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 24 Dec 2020 18:08:21 -0700 Subject: [PATCH 04/33] Add skip-ci message check per @dcherian request --- .github/workflows/upstream-dev-ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index e67268c5857..37a50c1e92b 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -16,7 +16,9 @@ jobs: runs-on: ubuntu-latest if: | contains(github.event.head_commit.message, 'test-upstream') - || (github.repository == 'pydata/xarray' && github.event_name != 'pull_request') + || (github.repository == 'pydata/xarray' + && github.event_name != 'pull_request' + && !contains(github.event.head_commit.message, 'skip-ci')) defaults: run: shell: bash -l {0} From abf228869e69078128003bccf0ad93fe82c99e8f Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 29 Dec 2020 16:25:58 -0700 Subject: [PATCH 05/33] Put `github.event_name == 'schedule'` back in --- .github/workflows/upstream-dev-ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 37a50c1e92b..370e557e21a 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -62,6 +62,7 @@ jobs: if: | failure() && steps.status.outcome == 'failure' + && github.event_name == 'schedule' && github.repository == 'pydata/xarray' uses: actions/upload-artifact@v2 with: @@ -74,6 +75,7 @@ jobs: needs: upstream-dev if: | always() + && github.event_name == 'schedule' && github.repository == 'pydata/xarray' && needs.upstream-dev.outputs.artifacts_availability == 'true' runs-on: ubuntu-latest From b21597a5f998049d25428b629f9c0bfb2e699337 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 29 Dec 2020 16:28:20 -0700 Subject: [PATCH 06/33] Fix if condition. Thanks @keewis --- .github/workflows/upstream-dev-ci.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 370e557e21a..4ffc7fe4e28 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -15,10 +15,11 @@ jobs: name: upstream-dev runs-on: ubuntu-latest if: | - contains(github.event.head_commit.message, 'test-upstream') - || (github.repository == 'pydata/xarray' - && github.event_name != 'pull_request' - && !contains(github.event.head_commit.message, 'skip-ci')) + github.repository == 'pydata/xarray' + && ( + (github.event_name == 'scheduled' || github.event_name == 'workflow_dispatch') + ||contains(github.event.head_commit.message, 'test-upstream') + ) defaults: run: shell: bash -l {0} From ddac8b21f48cc02ef41d4c581ebefa864be0a805 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 29 Dec 2020 16:31:25 -0700 Subject: [PATCH 07/33] Fix spacing --- .github/workflows/upstream-dev-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 4ffc7fe4e28..2a8d93de2ca 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -18,7 +18,7 @@ jobs: github.repository == 'pydata/xarray' && ( (github.event_name == 'scheduled' || github.event_name == 'workflow_dispatch') - ||contains(github.event.head_commit.message, 'test-upstream') + || contains(github.event.head_commit.message, 'test-upstream') ) defaults: run: From 0d99d80fedc6c66170f5c094ac6e1ef99fcf3d1a Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 3 Jan 2021 17:40:21 -0700 Subject: [PATCH 08/33] Add detect-ci-tirgger job per @keewis feedback Co-authored-by: keewis --- .github/workflows/upstream-dev-ci.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 2a8d93de2ca..1d650e8f871 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -11,14 +11,29 @@ on: workflow_dispatch: # allows you to trigger the workflow run manually jobs: + detect-ci-trigger: + name: detect upstream-dev ci trigger + runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event_name == 'pull_request' + outputs: + triggered: ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} + steps: + - name: check commit message + id: detect_trigger + run: | + git log -n 1 --pretty=format:%s | grep -q "\[test-upstream\]" \ + && echo '::set-output name=CI_TRIGGERED::true' \ + || echo '::set-output name=CI_TRIGGERED::false' + upstream-dev: name: upstream-dev runs-on: ubuntu-latest + needs: detect-ci-trigger if: | github.repository == 'pydata/xarray' && ( (github.event_name == 'scheduled' || github.event_name == 'workflow_dispatch') - || contains(github.event.head_commit.message, 'test-upstream') + || needs.detect-ci-trigger.outputs.triggered == 'true' ) defaults: run: From cd31a14a3b8ce080611f6eefb01d2aa0d59a7d39 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 3 Jan 2021 17:43:43 -0700 Subject: [PATCH 09/33] Checkout git repo --- .github/workflows/upstream-dev-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 1d650e8f871..cfe3af978f4 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -18,6 +18,7 @@ jobs: outputs: triggered: ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} steps: + - uses: actions/checkout@v2 - name: check commit message id: detect_trigger run: | From 2a8bc85fa812c258e7df15bde5ca7574f4d8ad66 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 02:16:32 +0100 Subject: [PATCH 10/33] empty commit to trigger the CI [test-upstream] From a1593f0ac044efb3af4fff675a43613168b35319 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 02:23:06 +0100 Subject: [PATCH 11/33] dedent the outputs section --- .github/workflows/upstream-dev-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index cfe3af978f4..71d7ec51a61 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'push' || github.event_name == 'pull_request' outputs: - triggered: ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} + triggered: ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} steps: - uses: actions/checkout@v2 - name: check commit message From 64818231a7dbd0f8ed665089f27c17a80a0da6de Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 02:25:10 +0100 Subject: [PATCH 12/33] add always to make sure the scheduled CI can run if check is skipped --- .github/workflows/upstream-dev-ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 71d7ec51a61..adaa1e9c93d 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -31,7 +31,8 @@ jobs: runs-on: ubuntu-latest needs: detect-ci-trigger if: | - github.repository == 'pydata/xarray' + always() + && github.repository == 'pydata/xarray' && ( (github.event_name == 'scheduled' || github.event_name == 'workflow_dispatch') || needs.detect-ci-trigger.outputs.triggered == 'true' From 96ab916969303ac5cd7e42788328281f012327d6 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 02:25:54 +0100 Subject: [PATCH 13/33] empty commit to trigger the CI [test-upstream] From fe67ddd31e59dd8d1737b82159deb9af5ca98ae0 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 02:29:59 +0100 Subject: [PATCH 14/33] add a step to print the detected status --- .github/workflows/upstream-dev-ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index adaa1e9c93d..dd29f2c7b38 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -25,6 +25,8 @@ jobs: git log -n 1 --pretty=format:%s | grep -q "\[test-upstream\]" \ && echo '::set-output name=CI_TRIGGERED::true' \ || echo '::set-output name=CI_TRIGGERED::false' + - name: show detected status + run: echo ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} upstream-dev: name: upstream-dev From 90201379c0dfe18d8dca7f4bb334742f8112e018 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 02:30:30 +0100 Subject: [PATCH 15/33] empty commit to trigger the CI [test-upstream] From bdfccd8a3a9ec5eea9167c273d0a4d19ba58c7d5 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 02:37:05 +0100 Subject: [PATCH 16/33] also print the commit message --- .github/workflows/upstream-dev-ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index dd29f2c7b38..3e962f7a6c3 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -26,7 +26,9 @@ jobs: && echo '::set-output name=CI_TRIGGERED::true' \ || echo '::set-output name=CI_TRIGGERED::false' - name: show detected status - run: echo ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} + run: | + git log -n 1 --pretty=format:%s + echo ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} upstream-dev: name: upstream-dev From 36dc775bc9d4b873ab0e2823fa809077774e8fb1 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 02:37:21 +0100 Subject: [PATCH 17/33] empty commit to trigger the CI [test-upstream] From bfa4cf7070ee28427b0dcbc6cd03136541f0f0a0 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 02:38:39 +0100 Subject: [PATCH 18/33] show the last two commit messages --- .github/workflows/upstream-dev-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 3e962f7a6c3..1aa7961ea67 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -27,7 +27,7 @@ jobs: || echo '::set-output name=CI_TRIGGERED::false' - name: show detected status run: | - git log -n 1 --pretty=format:%s + git log -n 2 --pretty=format:%s echo ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} upstream-dev: From 7b3851035a29c8dacc77aa324f427d126457abf0 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 3 Jan 2021 18:53:27 -0700 Subject: [PATCH 19/33] Use detached HEAD when checking out a branch --- .github/workflows/upstream-dev-ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 1aa7961ea67..433d140db69 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -19,6 +19,9 @@ jobs: triggered: ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} steps: - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - run: git checkout HEAD^ - name: check commit message id: detect_trigger run: | From d92ca5a596e860589f7b035c3132835764e86ddd Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 3 Jan 2021 19:02:13 -0700 Subject: [PATCH 20/33] fetch all history --- .github/workflows/upstream-dev-ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 433d140db69..1ff98f1962b 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -20,8 +20,8 @@ jobs: steps: - uses: actions/checkout@v2 with: - fetch-depth: 2 - - run: git checkout HEAD^ + fetch-depth: 0 + - run: git log -n 4 --pretty=format:%s - name: check commit message id: detect_trigger run: | From dea883e39f12f0da15f2759b937006d67ae5058a Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 3 Jan 2021 19:45:46 -0700 Subject: [PATCH 21/33] Try `github.event.number` ref --- .github/workflows/upstream-dev-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 1ff98f1962b..1d68e8021de 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - fetch-depth: 0 + ref: 'refs/pull/${{ github.event.number }}/merge' - run: git log -n 4 --pretty=format:%s - name: check commit message id: detect_trigger From ec023b8fe2bf46d3c80008d11ca3baf7927c872d Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 3 Jan 2021 19:55:49 -0700 Subject: [PATCH 22/33] Try head_ref --- .github/workflows/upstream-dev-ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 1d68e8021de..30ed22ba901 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -20,7 +20,8 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: 'refs/pull/${{ github.event.number }}/merge' + fetch-depth: 10 + ref: ${{ github.head_ref }} - run: git log -n 4 --pretty=format:%s - name: check commit message id: detect_trigger From 8802aac57f37c00b64eb30f9fa19c07be90d5670 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 3 Jan 2021 19:59:25 -0700 Subject: [PATCH 23/33] Fix typo --- .github/workflows/upstream-dev-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 30ed22ba901..8a942060e35 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 10 - ref: ${{ github.head_ref }} + ref: ${{ github.ref }} - run: git log -n 4 --pretty=format:%s - name: check commit message id: detect_trigger From 9cfe1e83e8f1b7091b7391b8f0372e5805cdf500 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Sun, 3 Jan 2021 20:03:14 -0700 Subject: [PATCH 24/33] [test-upstream] Increase `n` by 1 --- .github/workflows/upstream-dev-ci.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 8a942060e35..f0bd0cf5a09 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -20,18 +20,17 @@ jobs: steps: - uses: actions/checkout@v2 with: - fetch-depth: 10 + fetch-depth: 5 ref: ${{ github.ref }} - - run: git log -n 4 --pretty=format:%s - name: check commit message id: detect_trigger run: | - git log -n 1 --pretty=format:%s | grep -q "\[test-upstream\]" \ + git log -n 2 --pretty=format:%s | grep -q "\[test-upstream\]" \ && echo '::set-output name=CI_TRIGGERED::true' \ || echo '::set-output name=CI_TRIGGERED::false' - name: show detected status run: | - git log -n 2 --pretty=format:%s + git log -n 3 --pretty=format:%s echo ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} upstream-dev: From 687f4192ccb9ba898bd82b53349e88793604b7d5 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 15:32:27 +0100 Subject: [PATCH 25/33] add more steps to print information --- .github/workflows/upstream-dev-ci.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index f0bd0cf5a09..52635a287c7 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -22,6 +22,8 @@ jobs: with: fetch-depth: 5 ref: ${{ github.ref }} + - name: show the commit message + run: git log -n 1 --pretty=format:%s - name: check commit message id: detect_trigger run: | @@ -30,8 +32,7 @@ jobs: || echo '::set-output name=CI_TRIGGERED::false' - name: show detected status run: | - git log -n 3 --pretty=format:%s - echo ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} + echo "detected trigger: ${{ steps.detect_trigger.outputs.CI_TRIGGERED }}" upstream-dev: name: upstream-dev From 50f9cc066aeec5106ed9f932304b894d657a92b8 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 15:49:35 +0100 Subject: [PATCH 26/33] use HEAD or HEAD^2 to get the correct commit message --- .github/workflows/upstream-dev-ci.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 52635a287c7..216bab688e9 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -20,14 +20,22 @@ jobs: steps: - uses: actions/checkout@v2 with: - fetch-depth: 5 - ref: ${{ github.ref }} + fetch-depth: 2 + - name: determine the commit ref + id: determine_commit_ref + run: | + if [ ${{ github.event_name }} == 'pull_request' ]]; then + echo '::set-output name=REF::HEAD^2' + else + echo '::set-output name=REF::HEAD' + fi - name: show the commit message - run: git log -n 1 --pretty=format:%s + run: git log -n 1 --pretty=format:%s ${{ steps.determine_commit_ref.outputs.REF }} - name: check commit message id: detect_trigger run: | - git log -n 2 --pretty=format:%s | grep -q "\[test-upstream\]" \ + git log -n 1 --pretty=format:%s ${{ steps.determine_commit_ref.outputs.REF }} \ + | grep -q "\[test-upstream\]" \ && echo '::set-output name=CI_TRIGGERED::true' \ || echo '::set-output name=CI_TRIGGERED::false' - name: show detected status From 04a94786b1a348e64b24c531d8ae2e1572776630 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 15:55:53 +0100 Subject: [PATCH 27/33] fix the bash conditional --- .github/workflows/upstream-dev-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 216bab688e9..3e07cedc0ac 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -24,7 +24,7 @@ jobs: - name: determine the commit ref id: determine_commit_ref run: | - if [ ${{ github.event_name }} == 'pull_request' ]]; then + if [[ ${{ github.event_name }} == 'pull_request' ]]; then echo '::set-output name=REF::HEAD^2' else echo '::set-output name=REF::HEAD' From 4baacc3e1fb196cc0eb1d0b27aa737045922e718 Mon Sep 17 00:00:00 2001 From: Keewis Date: Mon, 4 Jan 2021 15:57:01 +0100 Subject: [PATCH 28/33] empty commit [test-upstream] From 368dfb513fd6fa5daecb4d5bf9d1c34727cf61c5 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 5 Jan 2021 13:57:18 -0700 Subject: [PATCH 29/33] [test-upstream] Use actions/detect-ci-trigger --- .github/workflows/upstream-dev-ci.yaml | 28 +++++--------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 3e07cedc0ac..fdd15735922 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -16,32 +16,14 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'push' || github.event_name == 'pull_request' outputs: - triggered: ${{ steps.detect_trigger.outputs.CI_TRIGGERED }} + triggered: ${{ steps.detect-trigger.outputs.trigger-found }} steps: - uses: actions/checkout@v2 + - uses: ./.github/actions/detect-ci-trigger + id: detect-trigger with: - fetch-depth: 2 - - name: determine the commit ref - id: determine_commit_ref - run: | - if [[ ${{ github.event_name }} == 'pull_request' ]]; then - echo '::set-output name=REF::HEAD^2' - else - echo '::set-output name=REF::HEAD' - fi - - name: show the commit message - run: git log -n 1 --pretty=format:%s ${{ steps.determine_commit_ref.outputs.REF }} - - name: check commit message - id: detect_trigger - run: | - git log -n 1 --pretty=format:%s ${{ steps.determine_commit_ref.outputs.REF }} \ - | grep -q "\[test-upstream\]" \ - && echo '::set-output name=CI_TRIGGERED::true' \ - || echo '::set-output name=CI_TRIGGERED::false' - - name: show detected status - run: | - echo "detected trigger: ${{ steps.detect_trigger.outputs.CI_TRIGGERED }}" - + keyword: "test-upstream" + upstream-dev: name: upstream-dev runs-on: ubuntu-latest From 69e42184ffd13c8478190aa4a66f7021539ca604 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 5 Jan 2021 14:14:37 -0700 Subject: [PATCH 30/33] [test-upstream] Document how to trigger upstream CI --- .github/PULL_REQUEST_TEMPLATE.md | 3 +++ .github/workflows/upstream-dev-ci.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 91e55284e34..f46a87078f2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,3 +5,6 @@ - [ ] Passes `isort . && black . && mypy . && flake8` - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` + + +By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior by adding a `[test-upstream]` tag in the body of the git commit or the commit’s title. diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index fdd15735922..cb5e1272d91 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -22,7 +22,7 @@ jobs: - uses: ./.github/actions/detect-ci-trigger id: detect-trigger with: - keyword: "test-upstream" + keyword: "[test-upstream]" upstream-dev: name: upstream-dev From 4596f47b10f8354ad1651c9f9801205379a494ea Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 5 Jan 2021 14:38:24 -0700 Subject: [PATCH 31/33] Remove the part about the body of the git commit --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f46a87078f2..069a313be49 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,4 +7,4 @@ - [ ] New functions/methods are listed in `api.rst` -By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior by adding a `[test-upstream]` tag in the body of the git commit or the commit’s title. +By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior by adding a `[test-upstream]` tag in the git commit’s title. From dbfecd64e8d6759061f7d2b7460883589aabf54f Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 5 Jan 2021 15:47:53 -0700 Subject: [PATCH 32/33] Update text about git commit message Co-authored-by: keewis --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 069a313be49..94dcf4328da 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,4 +7,4 @@ - [ ] New functions/methods are listed in `api.rst` -By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior by adding a `[test-upstream]` tag in the git commit’s title. +By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior per commit by adding a `[test-upstream]` tag in the first line of the commit message. From 14c3c9639b2b196cebf77ae28d03d30f90bee85f Mon Sep 17 00:00:00 2001 From: keewis Date: Wed, 6 Jan 2021 20:24:57 +0100 Subject: [PATCH 33/33] rewording --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 94dcf4328da..03e046512fb 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,4 +7,4 @@ - [ ] New functions/methods are listed in `api.rst` -By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior per commit by adding a `[test-upstream]` tag in the first line of the commit message. +By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior per commit by adding a `[test-upstream]` tag to the first line of the commit message.