Skip to content

Commit

Permalink
changes resulting from running on consul-enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurret committed Mar 30, 2023
1 parent 39a0c4f commit 77bafd8
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 53 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/build-distros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
uses: ./.github/workflows/reusable-check-go-mod.yml
with:
runs-on: ${{ needs.setup.outputs.compute-medium }}
repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}

build-386:
needs:
Expand All @@ -38,6 +41,12 @@ jobs:
runs-on: ${{ fromJSON(needs.setup.outputs.compute-medium) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0

# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(github.repository, '-enterprise') }}
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"

- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
Expand All @@ -56,6 +65,12 @@ jobs:
runs-on: ${{ fromJSON(needs.setup.outputs.compute-medium) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0

# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(github.repository, '-enterprise') }}
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"

- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
Expand All @@ -75,11 +90,18 @@ jobs:
GOOS: linux
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0

# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(github.repository, '-enterprise') }}
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"


- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
- run: |
sudo rm -fv /etc/apt/sources.list.d/github_git-lfs.list # workaround for https://github.com/actions/runner-images/issues/1983
# sudo rm -fv /etc/apt/sources.list.d/github_git-lfs.list # workaround for https://github.com/actions/runner-images/issues/1983
sudo apt-get update --allow-releaseinfo-change-suite --allow-releaseinfo-change-version && sudo apt-get install -y gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
- run: CC=arm-linux-gnueabi-gcc GOARCH=arm GOARM=5 go build
Expand Down
100 changes: 83 additions & 17 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,20 @@ jobs:
uses: ./.github/workflows/reusable-check-go-mod.yml
with:
runs-on: ${{ needs.setup.outputs.compute-small }}

repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}

check-generated-protobuf:
needs:
- setup
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(github.repository, '-enterprise') }}
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
Expand All @@ -62,14 +69,18 @@ jobs:
- run: make proto-lint
name: "Protobuf Lint"
- name: Notify Slack
if: failure()
if: ${{ failure() }}
run: .github/scripts/notify_slack.sh
check-generated-deep-copy:
needs:
- setup
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(github.repository, '-enterprise') }}
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
Expand All @@ -82,34 +93,42 @@ jobs:
exit 1
fi
- name: Notify Slack
if: failure()
run: .github/scripts/notify_slack.sh
if: ${{ failure() }}
run: .github/scripts/notify_slack.sh

lint-enums:
needs:
- setup
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(github.repository, '-enterprise') }}
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
- run: go install github.com/reillywatson/enumcover/cmd/enumcover@master && enumcover ./...
- name: Notify Slack
if: failure()
if: ${{ failure() }}
run: .github/scripts/notify_slack.sh

lint-container-test-deps:
needs:
- setup
needs:
- setup
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
- run: make lint-container-test-deps
- run: make lint-container-test-deps
- name: Notify Slack
if: failure()
if: ${{ failure() }}
run: .github/scripts/notify_slack.sh

lint-consul-retry:
Expand All @@ -118,12 +137,16 @@ jobs:
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(github.repository, '-enterprise') }}
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
- run: go install github.com/hashicorp/lint-consul-retry@master && lint-consul-retry
- name: Notify Slack
if: failure()
if: ${{ failure() }}
run: .github/scripts/notify_slack.sh

lint:
Expand All @@ -132,6 +155,9 @@ jobs:
uses: ./.github/workflows/reusable-lint.yml
with:
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}

lint-32bit:
needs:
Expand All @@ -140,7 +166,9 @@ jobs:
with:
go-arch: "386"
runs-on: ${{ needs.setup.outputs.compute-xl }}

repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}

# create a development build
dev-build:
Expand All @@ -149,7 +177,10 @@ jobs:
uses: ./.github/workflows/reusable-dev-build.yml
with:
runs-on: ${{ needs.setup.outputs.compute-xl }}

repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}

# TODO(JM): - linux arm64 is not available in our self-hosted runners
# they are currently on the roadmap.
# # create a development build for arm64
Expand Down Expand Up @@ -183,7 +214,10 @@ jobs:
directory: .
runner-count: 12
runs-on: ${{ needs.setup.outputs.compute-xl }}

repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-race:
needs:
Expand All @@ -195,6 +229,10 @@ jobs:
go-test-flags: 'GO_TEST_FLAGS="-race -gcflags=all=-d=checkptr=0"'
package-names-command: "go list ./... | grep -E -v '^github.com/hashicorp/consul/agent(/consul|/local|/routine-leak-checker)?$' | grep -E -v '^github.com/hashicorp/consul/command/'"
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-32bit:
needs:
Expand All @@ -206,24 +244,36 @@ jobs:
go-arch: "386"
go-test-flags: 'export GO_TEST_FLAGS="-short"'
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-envoyextensions:
needs:
- setup
needs:
- setup
- dev-build
uses: ./.github/workflows/reusable-unit.yml
with:
directory: envoyextensions
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-troubleshoot:
needs:
- setup
needs:
- setup
- dev-build
uses: ./.github/workflows/reusable-unit.yml
with:
directory: troubleshoot
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-api-1-19:
needs:
Expand All @@ -233,6 +283,10 @@ jobs:
with:
directory: api
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-api-1-20:
needs:
Expand All @@ -242,6 +296,10 @@ jobs:
with:
directory: api
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-sdk-1-19:
needs:
Expand All @@ -251,6 +309,10 @@ jobs:
with:
directory: sdk
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

go-test-sdk-1-20:
needs:
Expand All @@ -260,6 +322,10 @@ jobs:
with:
directory: sdk
runs-on: ${{ needs.setup.outputs.compute-xl }}
repository-name: ${{ github.repository }}
secrets:
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
consul-license: ${{secrets.CONSUL_LICENSE}}

noop:
runs-on: ubuntu-latest
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/reusable-check-go-mod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@ on:
description: An expression indicating which kind of runners to use.
required: true
type: string
repository-name:
required: true
type: string
secrets:
elevated-github-token:
required: true
jobs:
check-go-mod:
runs-on: ${{ fromJSON(inputs.runs-on) }}

steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(inputs.repository-name, '-enterprise') }}
run: git config --global url."https://${{ secrets.elevated-github-token }}:@github.com".insteadOf "https://github.com"
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
Expand All @@ -24,5 +34,5 @@ jobs:
exit 1
fi
- name: Notify Slack
if: failure()
if: ${{ failure() }}
run: .github/scripts/notify_slack.sh
12 changes: 11 additions & 1 deletion .github/workflows/reusable-dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@ on:
description: An expression indicating which kind of runners to use.
required: true
type: string
repository-name:
required: true
type: string
secrets:
elevated-github-token:
required: true
jobs:
build:
runs-on: ${{ fromJSON(inputs.runs-on) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(inputs.repository-name, '-enterprise') }}
run: git config --global url."https://${{ secrets.elevated-github-token }}:@github.com".insteadOf "https://github.com"
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
Expand All @@ -27,5 +37,5 @@ jobs:
name: ${{inputs.uploaded-binary-name}}
path: ./bin/consul
- name: Notify Slack
if: failure()
if: ${{ failure() }}
run: .github/scripts/notify_slack.sh
Loading

0 comments on commit 77bafd8

Please sign in to comment.