Skip to content

Commit

Permalink
Backport of ci: changes resulting from running on consul-enterprise i…
Browse files Browse the repository at this point in the history
…nto release/1.14.x (#16821)

* no-op commit due to failed cherry-picking

* ci: changes resulting from running on consul-enterprise (#16816)

* changes resulting from running on consul-enterprise

* removing comment line

* removing test for envoyextensions, troubleshoot, and linting of container-deps

---------

Co-authored-by: temp <[email protected]>
Co-authored-by: John Murret <[email protected]>
  • Loading branch information
3 people authored Mar 30, 2023
1 parent 98d11db commit f0ba563
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 45 deletions.
23 changes: 22 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 # [email protected]

# 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 # [email protected]
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 # [email protected]

# 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 # [email protected]
with:
go-version-file: 'go.mod'
Expand All @@ -75,11 +90,17 @@ jobs:
GOOS: linux
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected]

# 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 # [email protected]
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 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
73 changes: 64 additions & 9 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 # [email protected]
# 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 # [email protected]
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 # [email protected]
# 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 # [email protected]
with:
go-version-file: 'go.mod'
Expand All @@ -82,20 +93,25 @@ 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 # [email protected]
# 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 # [email protected]
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-consul-retry:
Expand All @@ -104,12 +120,16 @@ jobs:
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected]
# 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 # [email protected]
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 @@ -118,6 +138,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 @@ -126,7 +149,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 @@ -135,7 +160,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 @@ -169,7 +197,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 @@ -181,6 +212,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 @@ -192,6 +227,10 @@ 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-api-1-19:
needs:
Expand All @@ -201,6 +240,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 @@ -210,6 +253,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 @@ -219,6 +266,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 @@ -228,6 +279,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 # [email protected]
# 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 # [email protected]
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 # [email protected]
# 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 # [email protected]
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
15 changes: 12 additions & 3 deletions .github/workflows/reusable-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ 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
env:
GOTAGS: "" # No tags for OSS but there are for enterprise
GOTAGS: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
GOARCH: ${{inputs.go-arch}}

jobs:
Expand All @@ -29,6 +34,10 @@ jobs:
name: lint ${{ matrix.directory }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected]
# 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 # [email protected]
with:
go-version-file: 'go.mod'
Expand All @@ -40,5 +49,5 @@ jobs:
version: v1.51
args: --build-tags="${{ env.GOTAGS }}" -v
- name: Notify Slack
if: failure()
if: ${{ failure() }}
run: .github/scripts/notify_slack.sh
Loading

0 comments on commit f0ba563

Please sign in to comment.