From d884835ecb7928f026a78cc9ad28815c2052815c Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Tue, 11 Aug 2020 15:28:47 +0200 Subject: [PATCH 1/4] Build aci tests / windows tests on push or on PR that request @test-aci, @test-windows in description --- .../{main-ci.yml => optional-ci.yml} | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) rename .github/workflows/{main-ci.yml => optional-ci.yml} (60%) diff --git a/.github/workflows/main-ci.yml b/.github/workflows/optional-ci.yml similarity index 60% rename from .github/workflows/main-ci.yml rename to .github/workflows/optional-ci.yml index 44733681..11badc5f 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/optional-ci.yml @@ -3,14 +3,41 @@ name: Continuous integration on: push: branches: - - main + - test_optional_ci + pull_request: jobs: + check-optional-tests: + name: Check if needs to run ACI or Windows tests + runs-on: ubuntu-latest + outputs: + trigger-aci: ${{steps.runacitest.outputs.triggered}} + trigger-windows: ${{steps.runwindowstest.outputs.triggered}} + steps: + - run: echo ${{github.ref}} + - run: echo ${{github.event_name}} + - uses: khan/pull-request-comment-trigger@master + name: Check if test ACI + if: github.event_name == 'pull_request' + id: runacitest + with: + trigger: '@test-aci' + - run: echo ${{steps.runacitest.outputs.triggered}} + - uses: khan/pull-request-comment-trigger@master + name: Check if test Windows + if: github.event_name == 'pull_request' + id: runwindowstest + with: + trigger: '@test-windows' + - run: echo ${{steps.runwindowstest.outputs.triggered}} + build: name: ACI e2e tests runs-on: ubuntu-latest env: GO111MODULE: "on" + needs: check-optional-tests + if: github.ref == 'refs/heads/test_optional_ci' || needs.check-optional-tests.outputs.trigger-aci == 'true' steps: - name: Set up Go 1.14 uses: actions/setup-go@v1 @@ -41,6 +68,8 @@ jobs: runs-on: windows-latest env: GO111MODULE: "on" + needs: check-optional-tests + if: github.ref == 'refs/heads/test_optional_ci' || needs.check-optional-tests.outputs.trigger-windows == 'true' steps: - name: Set up Go 1.14 uses: actions/setup-go@v1 From 6e4f580b9963db44faeba46159d27fd53cb9795d Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Tue, 11 Aug 2020 16:01:13 +0200 Subject: [PATCH 2/4] Force all tests on main branch after testing on separate branch --- .github/workflows/optional-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/optional-ci.yml b/.github/workflows/optional-ci.yml index 11badc5f..8853d354 100644 --- a/.github/workflows/optional-ci.yml +++ b/.github/workflows/optional-ci.yml @@ -3,7 +3,7 @@ name: Continuous integration on: push: branches: - - test_optional_ci + - main pull_request: jobs: @@ -37,7 +37,7 @@ jobs: env: GO111MODULE: "on" needs: check-optional-tests - if: github.ref == 'refs/heads/test_optional_ci' || needs.check-optional-tests.outputs.trigger-aci == 'true' + if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-aci == 'true' steps: - name: Set up Go 1.14 uses: actions/setup-go@v1 @@ -69,7 +69,7 @@ jobs: env: GO111MODULE: "on" needs: check-optional-tests - if: github.ref == 'refs/heads/test_optional_ci' || needs.check-optional-tests.outputs.trigger-windows == 'true' + if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-windows == 'true' steps: - name: Set up Go 1.14 uses: actions/setup-go@v1 From 9d5285a1dc176e5a3c9df203c8d017c18c51aac7 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Tue, 11 Aug 2020 16:15:09 +0200 Subject: [PATCH 3/4] Remove debugging --- .github/workflows/optional-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/optional-ci.yml b/.github/workflows/optional-ci.yml index 8853d354..2cfe9908 100644 --- a/.github/workflows/optional-ci.yml +++ b/.github/workflows/optional-ci.yml @@ -14,22 +14,18 @@ jobs: trigger-aci: ${{steps.runacitest.outputs.triggered}} trigger-windows: ${{steps.runwindowstest.outputs.triggered}} steps: - - run: echo ${{github.ref}} - - run: echo ${{github.event_name}} - uses: khan/pull-request-comment-trigger@master name: Check if test ACI if: github.event_name == 'pull_request' id: runacitest with: trigger: '@test-aci' - - run: echo ${{steps.runacitest.outputs.triggered}} - uses: khan/pull-request-comment-trigger@master name: Check if test Windows if: github.event_name == 'pull_request' id: runwindowstest with: trigger: '@test-windows' - - run: echo ${{steps.runwindowstest.outputs.triggered}} build: name: ACI e2e tests From d06d5ae3588ea3c5ec0b4b6a7b3f7cbd354271d2 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Tue, 11 Aug 2020 16:49:42 +0200 Subject: [PATCH 4/4] Document optional test triggers in PR template. Beware, @test-aci or @test-windows in comments will also trigger tests, comments are not ignored for this --- .github/PULL_REQUEST_TEMPLATE.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 655d1b93..28ce12ce 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,12 @@ **What I did** **Related issue** -<-- If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" --> + + + **(not mandatory) A picture of a cute animal, if possible in relation with what you did**