Skip to content

Commit

Permalink
Backport of Add a new category of runners to the CI workflow; use new…
Browse files Browse the repository at this point in the history
…, dedicated … into release/1.13.x (hashicorp#19855)

* backport of commit daf4ec2

* Add compute-huge output to setup step in CI

* Remove redundant fromJSON call

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
  • Loading branch information
hc-github-team-secure-vault-core and kubawi authored Mar 30, 2023
1 parent 4c2c88f commit 8530990
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ jobs:
name: Setup
runs-on: ubuntu-latest
outputs:
compute-tiny: ${{ steps.setup-outputs.outputs.compute-tiny }}
compute-standard: ${{ steps.setup-outputs.outputs.compute-standard }}
compute-larger: ${{ steps.setup-outputs.outputs.compute-larger }}
compute-huge: ${{ steps.setup-outputs.outputs.compute-huge }}
enterprise: ${{ steps.setup-outputs.outputs.enterprise }}
go-build-tags: ${{ steps.setup-outputs.outputs.go-build-tags }}
steps:
Expand All @@ -22,22 +24,26 @@ jobs:
if [ "${github_repository##*/}" == "vault-enterprise" ] ; then
# shellcheck disable=SC2129
echo 'compute-tiny=["self-hosted","ondemand","linux","type=m5.large"]' >> "$GITHUB_OUTPUT"
echo 'compute-standard=["self-hosted","ondemand","linux","type=m5.xlarge"]' >> "$GITHUB_OUTPUT"
echo 'compute-larger=["self-hosted","ondemand","linux","type=m5.2xlarge"]' >> "$GITHUB_OUTPUT"
echo 'compute-huge=["self-hosted","ondemand","linux","type=m5.4xlarge"]' >> "$GITHUB_OUTPUT"
echo 'enterprise=1' >> "$GITHUB_OUTPUT"
echo 'go-build-tags=ent,enterprise' >> "$GITHUB_OUTPUT"
else
# shellcheck disable=SC2129
echo 'compute-standard=["custom", "linux", "small"]' >> "$GITHUB_OUTPUT"
echo 'compute-larger=["custom", "linux", "medium"]' >> "$GITHUB_OUTPUT"
echo 'compute-tiny="ubuntu-latest"' >> "$GITHUB_OUTPUT"
echo 'compute-standard="custom-linux-xl-vault-latest"' >> "$GITHUB_OUTPUT"
echo 'compute-larger="custom-linux-xl-vault-latest"' >> "$GITHUB_OUTPUT"
echo 'compute-huge="custom-linux-xl-vault-latest"' >> "$GITHUB_OUTPUT"
echo 'enterprise=' >> "$GITHUB_OUTPUT"
echo 'go-build-tags=' >> "$GITHUB_OUTPUT"
fi
semgrep:
name: Semgrep
needs:
- setup
runs-on: ${{ fromJSON(needs.setup.outputs.compute-standard) }}
runs-on: ${{ fromJSON(needs.setup.outputs.compute-tiny) }}
container:
image: returntocorp/semgrep@sha256:ffc6f3567654f9431456d49fd059dfe548f007c494a7eb6cd5a1a3e50d813fb3
steps:
Expand All @@ -51,13 +57,13 @@ jobs:
- setup
uses: ./.github/workflows/setup-go-cache.yml
with:
runs-on: ${{ needs.setup.outputs.compute-larger }}
runs-on: ${{ needs.setup.outputs.compute-standard }}
secrets: inherit
fmt:
name: Check Format
needs:
- setup
runs-on: ${{ fromJSON(needs.setup.outputs.compute-standard) }}
runs-on: ${{ fromJSON(needs.setup.outputs.compute-tiny) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613
Expand All @@ -77,7 +83,7 @@ jobs:
needs:
- setup
if: ${{ needs.setup.outputs.enterprise != '' && github.base_ref != '' }}
runs-on: ['self-hosted','ondemand','small']
runs-on: ${{ fromJSON(needs.setup.outputs.compute-tiny) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
Expand Down Expand Up @@ -117,7 +123,7 @@ jobs:
total-runners: 16
go-arch: amd64
go-build-tags: '${{ needs.setup.outputs.go-build-tags }},deadlock'
runs-on: ${{ needs.setup.outputs.compute-standard }}
runs-on: ${{ needs.setup.outputs.compute-larger }}
enterprise: ${{ needs.setup.outputs.enterprise }}
secrets: inherit
test-go-race:
Expand All @@ -138,7 +144,7 @@ jobs:
extra-flags: '-race'
go-arch: amd64
go-build-tags: ${{ needs.setup.outputs.go-build-tags }}
runs-on: ${{ needs.setup.outputs.compute-larger }}
runs-on: ${{ needs.setup.outputs.compute-huge }}
enterprise: ${{ needs.setup.outputs.enterprise }}
secrets: inherit
test-go-fips:
Expand All @@ -160,7 +166,7 @@ jobs:
}
go-arch: amd64
go-build-tags: '${{ needs.setup.outputs.go-build-tags }},deadlock,cgo,fips,fips_140_2'
runs-on: ${{ needs.setup.outputs.compute-standard }}
runs-on: ${{ needs.setup.outputs.compute-larger }}
enterprise: ${{ needs.setup.outputs.enterprise }}
secrets: inherit
test-ui:
Expand All @@ -172,7 +178,7 @@ jobs:
permissions:
id-token: write
contents: read
runs-on: ${{ fromJSON(needs.setup.outputs.compute-standard) }}
runs-on: ${{ fromJSON(needs.setup.outputs.compute-larger) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613
Expand Down Expand Up @@ -261,6 +267,6 @@ jobs:
- setup
- test-go
- test-ui
runs-on: ${{ fromJSON(needs.setup.outputs.compute-standard) }}
runs-on: ${{ fromJSON(needs.setup.outputs.compute-tiny) }}
steps:
- run: echo "All Go test successfully passed"

0 comments on commit 8530990

Please sign in to comment.