Skip to content

Commit

Permalink
Backport of ci: Add success jobs. make go-test-enterprise conditional…
Browse files Browse the repository at this point in the history
…. build-distros and go-tests trigger on push to main and release branches into release/1.13.x (#16908)

* backport of commit b95230e

* backport of commit 763a5dc

* backport of commit 5fd35bf

* backport of commit c1d4fb1

* backport of commit b5083fc

* backport of commit 31ea1f6

* Update go-tests.yml

* Update go-tests.yml

---------

Co-authored-by: John Murret <[email protected]>
  • Loading branch information
hc-github-team-consul-core and jmurret authored Apr 6, 2023
1 parent 3b22a67 commit 977ed28
Showing 1 changed file with 42 additions and 28 deletions.
70 changes: 42 additions & 28 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ jobs:
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-enterprise:
if: ${{ endsWith(github.repository, '-enterprise') }}
needs:
- setup
- dev-build
Expand Down Expand Up @@ -258,34 +259,6 @@ jobs:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-envoyextensions:
needs:
- setup
- dev-build
uses: ./.github/workflows/reusable-unit.yml
with:
directory: envoyextensions
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-troubleshoot:
needs:
- setup
- dev-build
uses: ./.github/workflows/reusable-unit.yml
with:
directory: troubleshoot
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-api-1-19:
needs:
- setup
Expand Down Expand Up @@ -346,3 +319,44 @@ 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-enums
- lint
- lint-32bit
# - go-test-arm64
- go-test-enterprise
- go-test-oss
- go-test-race
- 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"

0 comments on commit 977ed28

Please sign in to comment.