From 9441833a5fa934b5dabd3dab05eda854a53c4adc Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Fri, 7 Apr 2023 15:06:20 -0400 Subject: [PATCH] Backport of ci: increase ENT runner size for xl to match OSS. have build-distros use xl to match CircleCI into release/1.13.x (#16922) * no-op commit due to failed cherry-picking * increase ENT runner size for xl to match OSS. have guild-distros use xl to match CircleCI (#16920) * ci: Add success jobs. make go-test-enterprise conditional. build-distros and go-tests trigger on push to main and release branches (#16905) * Add go-tests-success job and make go-test-enterprise conditional * fixing lint-32bit reference * fixing reference to -go-test-troubleshoot * add all jobs that fan out. * fixing success job to need set up * add echo to success job * adding success jobs to build-artifacts, build-distros, and frontend. * changing the name of the job in verify ci to be consistent with other workflows * enable go-tests, build-distros, and verify-ci to run on merge to main and release branches because they currently do not with just the pull_request trigger --------- Co-authored-by: temp Co-authored-by: John Murret --- .github/scripts/get_runner_classes.sh | 3 +- .github/workflows/build-distros.yml | 41 +++++++++++++++++++++++++-- .github/workflows/frontend.yml | 28 ++++++++++++++++++ .github/workflows/go-tests.yml | 5 ++++ .github/workflows/verify-ci.yml | 12 ++++++-- 5 files changed, 82 insertions(+), 7 deletions(-) diff --git a/.github/scripts/get_runner_classes.sh b/.github/scripts/get_runner_classes.sh index 4834e9e92917..b722ba768786 100755 --- a/.github/scripts/get_runner_classes.sh +++ b/.github/scripts/get_runner_classes.sh @@ -10,7 +10,8 @@ case "$GITHUB_REPOSITORY" in echo "compute-small=['self-hosted', 'linux', 'small']" >> "$GITHUB_OUTPUT" echo "compute-medium=['self-hosted', 'linux', 'medium']" >> "$GITHUB_OUTPUT" echo "compute-large=['self-hosted', 'linux', 'large']" >> "$GITHUB_OUTPUT" - echo "compute-xl=['self-hosted', 'ondemand', 'linux', 'type=m5.2xlarge']" >> "$GITHUB_OUTPUT" + # m5d.8xlarge is equivalent to our xl custom runner in OSS + echo "compute-xl=['self-hosted', 'ondemand', 'linux', 'type=m5d.8xlarge']" >> "$GITHUB_OUTPUT" ;; *) # shellcheck disable=SC2129 diff --git a/.github/workflows/build-distros.yml b/.github/workflows/build-distros.yml index 8b6c6d9930f9..c8036a75055e 100644 --- a/.github/workflows/build-distros.yml +++ b/.github/workflows/build-distros.yml @@ -2,7 +2,13 @@ # It is aimed at checking new commits don't introduce any breaking build changes. name: build-distros -on: [pull_request] +on: + pull_request: + push: + branches: + # Push events on the main branch + - main + - release/** permissions: contents: read @@ -38,7 +44,7 @@ jobs: - check-go-mod env: XC_OS: "freebsd linux windows" - runs-on: ${{ fromJSON(needs.setup.outputs.compute-medium) }} + runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0 @@ -62,7 +68,7 @@ jobs: - check-go-mod env: XC_OS: "darwin freebsd linux solaris windows" - runs-on: ${{ fromJSON(needs.setup.outputs.compute-medium) }} + runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0 @@ -106,3 +112,32 @@ jobs: - run: CC=arm-linux-gnueabi-gcc GOARCH=arm GOARM=5 go build - run: CC=arm-linux-gnueabihf-gcc GOARCH=arm GOARM=6 go build - run: CC=aarch64-linux-gnu-gcc GOARCH=arm64 go build + + # 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. + + build-distros-success: + needs: + - setup + - check-go-mod + - build-386 + - build-amd64 + - build-arm + runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} + if: | + (always() && ! cancelled()) && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + steps: + - run: echo "build-distros succeeded" diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 094d86ad5555..b6451a378c36 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -104,3 +104,31 @@ jobs: - working-directory: ui/packages/consul-ui run: make test-coverage-ci + + # 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. + + frontend-success: + needs: + - setup + - workspace-tests + - node-tests + - ember-build-test + runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} + if: | + (always() && ! cancelled()) && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + steps: + - run: echo "frontend succeeded" diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 6350d9fdd93e..ef833a02a1fa 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -10,6 +10,11 @@ on: - 'backport/docs/**' - 'backport/ui/**' - 'backport/mktg-**' + push: + branches: + # Push events on the main branch + - main + - release/** permissions: contents: read diff --git a/.github/workflows/verify-ci.yml b/.github/workflows/verify-ci.yml index 16fb4db25be5..4bd4536add1a 100644 --- a/.github/workflows/verify-ci.yml +++ b/.github/workflows/verify-ci.yml @@ -8,10 +8,16 @@ name: verify-ci permissions: contents: read -on: [pull_request] +on: + pull_request: + push: + branches: + # Push events on the main branch + - main + - release/** jobs: - noop: + verify-ci-success: runs-on: ubuntu-latest steps: - - run: echo "ok" + - run: echo "verify-ci succeeded"