From 3c35238da3a6243e36485b0e1757e830201700a0 Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Thu, 6 Apr 2023 19:20:32 -0400 Subject: [PATCH] Backport of ci: Add success jobs. make go-test-enterprise conditional. build-distros and go-tests trigger on push to main and release branches into release/1.15.x (#16913) * backport of commit b95230eedcae50380c8f83100139fa58b7fbfa19 * backport of commit 763a5dc5d861b5f8689756feab6fa3f453281970 * backport of commit 5fd35bf7b8cc5e8294e53340c0e64abe9fc3ed0e * backport of commit c1d4fb1fd0b3795f7f8bd0881b1ff6f3d927ebf2 * backport of commit b5083fc1495f186f3fccabbb8ef4026481515782 * backport of commit 31ea1f60bc0052913a7c53aba1c57f9ed767be21 --------- Co-authored-by: John Murret --- .github/workflows/go-tests.yml | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index ca90ac31d3..83c37d3b32 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -229,6 +229,7 @@ jobs: consul-license: ${{secrets.CONSUL_LICENSE}} go-test-enterprise: + if: ${{ endsWith(github.repository, '-enterprise') }} needs: - setup - dev-build @@ -363,3 +364,47 @@ jobs: runs-on: ubuntu-latest steps: - run: "echo ok" + + # This is job is required for branch protection as a required gihub check + # because GitHub actions show up as checks at the job level and not the + # workflow level. This is currently a feature request: + # https://github.com/orgs/community/discussions/12395 + # + # This job must: + # - be placed after the fanout of a workflow so that everything fans back in + # to this job. + # - "need" any job that is part of the fan out / fan in + # - implement the if logic because we have conditional jobs + # (go-test-enteprise) that this job needs and this would potentially get + # skipped if a previous job got skipped. So we use the if clause to make + # sure it does not get skipped. + + go-tests-success: + needs: + - setup + - check-generated-deep-copy + - check-generated-protobuf + - check-go-mod + - lint-consul-retry + - lint-container-test-deps + - lint-enums + - lint + - lint-32bit + # - go-test-arm64 + - go-test-enterprise + - go-test-oss + - go-test-race + - go-test-envoyextensions + - go-test-troubleshoot + - go-test-api-1-19 + - go-test-api-1-20 + - go-test-sdk-1-19 + - go-test-sdk-1-20 + - go-test-32bit + runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} + if: | + (always() && ! cancelled()) && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + steps: + - run: echo "go-tests succeeded"