2023-03-28 21:29:27 +00:00
|
|
|
name: go-tests
|
|
|
|
|
2023-07-12 23:10:34 +00:00
|
|
|
on:
|
2023-03-28 21:29:27 +00:00
|
|
|
pull_request:
|
2023-07-24 16:05:43 +00:00
|
|
|
branches-ignore:
|
|
|
|
- stable-website
|
2023-03-28 21:29:27 +00:00
|
|
|
- 'docs/**'
|
|
|
|
- 'ui/**'
|
2023-07-24 16:05:43 +00:00
|
|
|
- 'mktg-**' # Digital Team Terraform-generated branches' prefix
|
|
|
|
- 'backport/docs/**'
|
|
|
|
- 'backport/ui/**'
|
|
|
|
- 'backport/mktg-**'
|
2023-04-06 22:29:32 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
# Push events on the main branch
|
|
|
|
- main
|
|
|
|
- release/**
|
2023-07-12 23:10:34 +00:00
|
|
|
|
2023-03-28 21:29:27 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
env:
|
|
|
|
TEST_RESULTS: /tmp/test-results
|
2023-06-21 15:26:27 +00:00
|
|
|
GOPRIVATE: github.com/hashicorp # Required for enterprise deps
|
2023-03-28 21:29:27 +00:00
|
|
|
|
2023-08-28 16:05:25 +00:00
|
|
|
# concurrency
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-03-28 21:29:27 +00:00
|
|
|
jobs:
|
2023-08-23 19:26:05 +00:00
|
|
|
conditional-skip:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Get files changed and conditionally skip CI
|
|
|
|
outputs:
|
|
|
|
trigger-ci: ${{ steps.read-files.outputs.trigger-ci }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Get changed files
|
|
|
|
id: read-files
|
|
|
|
run: ./.github/scripts/filter_changed_files_go_test.sh
|
|
|
|
|
2023-03-28 21:29:27 +00:00
|
|
|
setup:
|
2023-08-23 19:26:05 +00:00
|
|
|
needs: [conditional-skip]
|
2023-03-28 21:29:27 +00:00
|
|
|
name: Setup
|
2023-08-23 19:26:05 +00:00
|
|
|
if: needs.conditional-skip.outputs.trigger-ci == 'true'
|
2023-03-28 21:29:27 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
compute-small: ${{ steps.setup-outputs.outputs.compute-small }}
|
|
|
|
compute-medium: ${{ steps.setup-outputs.outputs.compute-medium }}
|
|
|
|
compute-large: ${{ steps.setup-outputs.outputs.compute-large }}
|
|
|
|
compute-xl: ${{ steps.setup-outputs.outputs.compute-xl }}
|
|
|
|
steps:
|
2023-07-19 23:56:50 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-03-28 21:29:27 +00:00
|
|
|
- id: setup-outputs
|
|
|
|
name: Setup outputs
|
|
|
|
run: ./.github/scripts/get_runner_classes.sh
|
|
|
|
|
|
|
|
check-go-mod:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
2023-03-28 21:29:27 +00:00
|
|
|
- setup
|
|
|
|
uses: ./.github/workflows/reusable-check-go-mod.yml
|
|
|
|
with:
|
|
|
|
runs-on: ${{ needs.setup.outputs.compute-small }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
|
2023-03-28 21:29:27 +00:00
|
|
|
check-generated-protobuf:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-06-22 14:56:45 +00:00
|
|
|
runs-on: ${{ fromJSON(needs.setup.outputs.compute-medium) }}
|
2023-03-28 21:29:27 +00:00
|
|
|
steps:
|
2023-07-19 23:56:50 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-03-30 16:57:11 +00:00
|
|
|
# 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"
|
2023-06-13 17:00:55 +00:00
|
|
|
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
|
2023-03-28 21:29:27 +00:00
|
|
|
with:
|
|
|
|
go-version-file: 'go.mod'
|
|
|
|
- run: make proto-tools
|
|
|
|
name: Install protobuf
|
|
|
|
- run: make proto-format
|
|
|
|
name: "Protobuf Format"
|
|
|
|
- run: make --always-make proto
|
|
|
|
- run: |
|
|
|
|
if ! git diff --exit-code; then
|
|
|
|
echo "Generated code was not updated correctly"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
- run: make proto-lint
|
|
|
|
name: "Protobuf Lint"
|
|
|
|
- name: Notify Slack
|
2023-03-30 16:57:11 +00:00
|
|
|
if: ${{ failure() }}
|
2023-07-12 23:10:34 +00:00
|
|
|
run: .github/scripts/notify_slack.sh
|
2023-09-11 17:50:52 +00:00
|
|
|
check-codegen:
|
|
|
|
needs:
|
|
|
|
- setup
|
|
|
|
runs-on: ${{ fromJSON(needs.setup.outputs.compute-large) }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
|
|
|
# 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@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
|
|
|
|
with:
|
|
|
|
go-version-file: 'go.mod'
|
|
|
|
- run: make --always-make codegen
|
|
|
|
- run: |
|
|
|
|
if ! git diff --exit-code; then
|
|
|
|
echo "Generated code was not updated correctly"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
- name: Notify Slack
|
|
|
|
if: ${{ failure() }}
|
|
|
|
run: .github/scripts/notify_slack.sh
|
2023-03-30 16:57:11 +00:00
|
|
|
|
2023-03-28 21:29:27 +00:00
|
|
|
lint-enums:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-04-04 15:15:45 +00:00
|
|
|
runs-on: ${{ fromJSON(needs.setup.outputs.compute-large) }}
|
2023-03-28 21:29:27 +00:00
|
|
|
steps:
|
2023-07-19 23:56:50 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-03-30 16:57:11 +00:00
|
|
|
# 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"
|
2023-06-13 17:00:55 +00:00
|
|
|
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
|
2023-03-28 21:29:27 +00:00
|
|
|
with:
|
|
|
|
go-version-file: 'go.mod'
|
2023-07-12 23:10:34 +00:00
|
|
|
- run: go install github.com/reillywatson/enumcover/cmd/enumcover@master && enumcover ./...
|
2023-03-28 21:29:27 +00:00
|
|
|
- name: Notify Slack
|
2023-03-30 16:57:11 +00:00
|
|
|
if: ${{ failure() }}
|
2023-03-28 21:29:27 +00:00
|
|
|
run: .github/scripts/notify_slack.sh
|
|
|
|
|
|
|
|
lint-container-test-deps:
|
2023-03-30 16:57:11 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
|
|
|
|
steps:
|
2023-07-19 23:56:50 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-03-30 16:57:11 +00:00
|
|
|
# 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"
|
2023-06-13 17:00:55 +00:00
|
|
|
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
|
2023-03-28 21:29:27 +00:00
|
|
|
with:
|
|
|
|
go-version-file: 'go.mod'
|
2023-03-30 16:57:11 +00:00
|
|
|
- run: make lint-container-test-deps
|
2023-03-28 21:29:27 +00:00
|
|
|
- name: Notify Slack
|
2023-03-30 16:57:11 +00:00
|
|
|
if: ${{ failure() }}
|
2023-03-28 21:29:27 +00:00
|
|
|
run: .github/scripts/notify_slack.sh
|
|
|
|
|
|
|
|
lint-consul-retry:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
|
|
|
|
steps:
|
2023-07-19 23:56:50 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-03-30 16:57:11 +00:00
|
|
|
# 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"
|
2023-06-13 17:00:55 +00:00
|
|
|
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
|
2023-03-28 21:29:27 +00:00
|
|
|
with:
|
|
|
|
go-version-file: 'go.mod'
|
|
|
|
- run: go install github.com/hashicorp/lint-consul-retry@master && lint-consul-retry
|
|
|
|
- name: Notify Slack
|
2023-03-30 16:57:11 +00:00
|
|
|
if: ${{ failure() }}
|
2023-03-28 21:29:27 +00:00
|
|
|
run: .github/scripts/notify_slack.sh
|
|
|
|
|
|
|
|
lint:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
uses: ./.github/workflows/reusable-lint.yml
|
|
|
|
with:
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
lint-32bit:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
uses: ./.github/workflows/reusable-lint.yml
|
|
|
|
with:
|
|
|
|
go-arch: "386"
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
# create a development build
|
|
|
|
dev-build:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
uses: ./.github/workflows/reusable-dev-build.yml
|
2023-07-12 23:10:34 +00:00
|
|
|
with:
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
|
2023-07-25 17:58:12 +00:00
|
|
|
# dev-build-s390x:
|
|
|
|
# if: ${{ endsWith(github.repository, '-enterprise') }}
|
|
|
|
# needs:
|
|
|
|
# - setup
|
|
|
|
# uses: ./.github/workflows/reusable-dev-build.yml
|
|
|
|
# with:
|
|
|
|
# uploaded-binary-name: 'consul-bin-s390x'
|
2023-08-31 14:56:59 +00:00
|
|
|
# runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-07-25 17:58:12 +00:00
|
|
|
# go-arch: "s390x"
|
|
|
|
# repository-name: ${{ github.repository }}
|
|
|
|
# secrets:
|
|
|
|
# elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
2023-07-12 23:10:34 +00:00
|
|
|
|
2023-04-05 23:10:31 +00:00
|
|
|
# dev-build-arm64:
|
2023-08-22 14:46:03 +00:00
|
|
|
# # only run on enterprise because GHA does not have arm64 runners in CE
|
2023-04-05 23:10:31 +00:00
|
|
|
# if: ${{ endsWith(github.repository, '-enterprise') }}
|
2023-07-12 23:10:34 +00:00
|
|
|
# needs:
|
|
|
|
# - setup
|
2023-04-05 23:10:31 +00:00
|
|
|
# uses: ./.github/workflows/reusable-dev-build.yml
|
|
|
|
# with:
|
|
|
|
# uploaded-binary-name: 'consul-bin-arm64'
|
2023-08-31 14:56:59 +00:00
|
|
|
# runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-04-05 23:10:31 +00:00
|
|
|
# go-arch: "arm64"
|
|
|
|
# repository-name: ${{ github.repository }}
|
|
|
|
# secrets:
|
|
|
|
# elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
2023-03-28 21:29:27 +00:00
|
|
|
|
2023-04-05 23:10:31 +00:00
|
|
|
# go-test-arm64:
|
2023-08-22 14:46:03 +00:00
|
|
|
# # only run on enterprise because GHA does not have arm64 runners in CE
|
2023-04-05 23:10:31 +00:00
|
|
|
# if: ${{ endsWith(github.repository, '-enterprise') }}
|
2023-07-12 23:10:34 +00:00
|
|
|
# needs:
|
|
|
|
# - setup
|
2023-04-05 23:10:31 +00:00
|
|
|
# - dev-build-arm64
|
|
|
|
# uses: ./.github/workflows/reusable-unit-split.yml
|
|
|
|
# with:
|
|
|
|
# directory: .
|
|
|
|
# uploaded-binary-name: 'consul-bin-arm64'
|
|
|
|
# runner-count: 12
|
|
|
|
# runs-on: "['self-hosted', 'ondemand', 'os=macos-arm', 'arm64']"
|
|
|
|
# go-test-flags: 'if ! [[ "$GITHUB_REF_NAME" =~ ^main$|^release/ ]]; then export GO_TEST_FLAGS="-short"; fi'
|
|
|
|
# repository-name: ${{ github.repository }}
|
|
|
|
# secrets:
|
|
|
|
# elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
# consul-license: ${{secrets.CONSUL_LICENSE}}
|
2023-05-10 20:49:18 +00:00
|
|
|
# datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-03-28 21:29:27 +00:00
|
|
|
|
2023-08-22 14:46:03 +00:00
|
|
|
go-test-ce:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
- dev-build
|
|
|
|
uses: ./.github/workflows/reusable-unit-split.yml
|
|
|
|
with:
|
|
|
|
directory: .
|
|
|
|
runner-count: 12
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
2023-04-05 22:49:48 +00:00
|
|
|
go-tags: ""
|
2023-05-10 20:49:18 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
2023-07-12 23:10:34 +00:00
|
|
|
contents: read
|
2023-04-05 22:49:48 +00:00
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
consul-license: ${{secrets.CONSUL_LICENSE}}
|
2023-05-10 20:49:18 +00:00
|
|
|
datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-04-05 22:49:48 +00:00
|
|
|
|
|
|
|
go-test-enterprise:
|
2023-04-06 22:29:32 +00:00
|
|
|
if: ${{ endsWith(github.repository, '-enterprise') }}
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-04-05 22:49:48 +00:00
|
|
|
- dev-build
|
|
|
|
uses: ./.github/workflows/reusable-unit-split.yml
|
|
|
|
with:
|
|
|
|
directory: .
|
|
|
|
runner-count: 12
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-04-05 22:49:48 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
|
|
|
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
|
2023-05-10 20:49:18 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
2023-07-12 23:10:34 +00:00
|
|
|
contents: read
|
2023-03-30 16:57:11 +00:00
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
consul-license: ${{secrets.CONSUL_LICENSE}}
|
2023-05-10 20:49:18 +00:00
|
|
|
datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
go-test-race:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
- dev-build
|
|
|
|
uses: ./.github/workflows/reusable-unit.yml
|
|
|
|
with:
|
|
|
|
directory: .
|
|
|
|
go-test-flags: 'GO_TEST_FLAGS="-race -gcflags=all=-d=checkptr=0"'
|
2023-03-31 03:39:34 +00:00
|
|
|
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|/connect|/snapshot)'"
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
2023-04-05 22:49:48 +00:00
|
|
|
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
|
2023-05-10 20:49:18 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
2023-07-12 23:10:34 +00:00
|
|
|
contents: read
|
2023-03-30 16:57:11 +00:00
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
consul-license: ${{secrets.CONSUL_LICENSE}}
|
2023-05-10 20:49:18 +00:00
|
|
|
datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
go-test-32bit:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
- dev-build
|
|
|
|
uses: ./.github/workflows/reusable-unit.yml
|
|
|
|
with:
|
|
|
|
directory: .
|
|
|
|
go-arch: "386"
|
|
|
|
go-test-flags: 'export GO_TEST_FLAGS="-short"'
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
2023-04-05 22:49:48 +00:00
|
|
|
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
|
2023-05-10 20:49:18 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
2023-07-12 23:10:34 +00:00
|
|
|
contents: read
|
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
consul-license: ${{secrets.CONSUL_LICENSE}}
|
|
|
|
datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
|
|
|
|
2023-07-25 17:58:12 +00:00
|
|
|
# go-test-s390x:
|
|
|
|
# if: ${{ endsWith(github.repository, '-enterprise') }}
|
|
|
|
# needs:
|
|
|
|
# - setup
|
|
|
|
# - dev-build-s390x
|
|
|
|
# uses: ./.github/workflows/reusable-unit.yml
|
|
|
|
# with:
|
|
|
|
# uploaded-binary-name: 'consul-bin-s390x'
|
|
|
|
# directory: .
|
|
|
|
# go-test-flags: 'export GO_TEST_FLAGS="-short"'
|
2023-08-31 14:56:59 +00:00
|
|
|
# runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-07-25 17:58:12 +00:00
|
|
|
# repository-name: ${{ github.repository }}
|
|
|
|
# go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
|
|
|
|
# permissions:
|
|
|
|
# id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
|
|
|
# contents: read
|
|
|
|
# secrets:
|
|
|
|
# elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
# consul-license: ${{secrets.CONSUL_LICENSE}}
|
|
|
|
# datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
go-test-envoyextensions:
|
2023-03-30 16:57:11 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
- dev-build
|
|
|
|
uses: ./.github/workflows/reusable-unit.yml
|
|
|
|
with:
|
|
|
|
directory: envoyextensions
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
2023-04-05 22:49:48 +00:00
|
|
|
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
|
2023-05-10 20:49:18 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
2023-07-12 23:10:34 +00:00
|
|
|
contents: read
|
2023-03-30 16:57:11 +00:00
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
consul-license: ${{secrets.CONSUL_LICENSE}}
|
2023-05-10 20:49:18 +00:00
|
|
|
datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
go-test-troubleshoot:
|
2023-03-30 16:57:11 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
- dev-build
|
|
|
|
uses: ./.github/workflows/reusable-unit.yml
|
|
|
|
with:
|
|
|
|
directory: troubleshoot
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
2023-04-05 22:49:48 +00:00
|
|
|
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
|
2023-05-10 20:49:18 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
2023-07-12 23:10:34 +00:00
|
|
|
contents: read
|
2023-03-30 16:57:11 +00:00
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
consul-license: ${{secrets.CONSUL_LICENSE}}
|
2023-05-10 20:49:18 +00:00
|
|
|
datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
go-test-api-1-19:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
- dev-build
|
|
|
|
uses: ./.github/workflows/reusable-unit.yml
|
|
|
|
with:
|
|
|
|
directory: api
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
2023-04-05 22:49:48 +00:00
|
|
|
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
|
2023-07-14 20:53:27 +00:00
|
|
|
go-version: "1.19"
|
2023-05-10 20:49:18 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
2023-07-12 23:10:34 +00:00
|
|
|
contents: read
|
2023-03-30 16:57:11 +00:00
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
consul-license: ${{secrets.CONSUL_LICENSE}}
|
2023-05-10 20:49:18 +00:00
|
|
|
datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
go-test-api-1-20:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
- dev-build
|
|
|
|
uses: ./.github/workflows/reusable-unit.yml
|
|
|
|
with:
|
|
|
|
directory: api
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
2023-04-05 22:49:48 +00:00
|
|
|
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
|
2023-07-14 20:53:27 +00:00
|
|
|
go-version: "1.20"
|
2023-05-10 20:49:18 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
2023-07-12 23:10:34 +00:00
|
|
|
contents: read
|
2023-03-30 16:57:11 +00:00
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
consul-license: ${{secrets.CONSUL_LICENSE}}
|
2023-05-10 20:49:18 +00:00
|
|
|
datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
go-test-sdk-1-19:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
- dev-build
|
|
|
|
uses: ./.github/workflows/reusable-unit.yml
|
|
|
|
with:
|
|
|
|
directory: sdk
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
2023-04-05 22:49:48 +00:00
|
|
|
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
|
2023-07-13 19:26:35 +00:00
|
|
|
go-version: "1.19"
|
2023-05-10 20:49:18 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
2023-07-12 23:10:34 +00:00
|
|
|
contents: read
|
2023-03-30 16:57:11 +00:00
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
consul-license: ${{secrets.CONSUL_LICENSE}}
|
2023-05-10 20:49:18 +00:00
|
|
|
datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
go-test-sdk-1-20:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
|
|
|
- setup
|
2023-03-28 21:29:27 +00:00
|
|
|
- dev-build
|
|
|
|
uses: ./.github/workflows/reusable-unit.yml
|
|
|
|
with:
|
|
|
|
directory: sdk
|
2023-08-31 14:56:59 +00:00
|
|
|
runs-on: ${{ needs.setup.outputs.compute-large }}
|
2023-03-30 16:57:11 +00:00
|
|
|
repository-name: ${{ github.repository }}
|
2023-04-05 22:49:48 +00:00
|
|
|
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}"
|
2023-07-14 20:53:27 +00:00
|
|
|
go-version: "1.20"
|
2023-05-10 20:49:18 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write # NOTE: this permission is explicitly required for Vault auth.
|
2023-07-12 23:10:34 +00:00
|
|
|
contents: read
|
2023-03-30 16:57:11 +00:00
|
|
|
secrets:
|
|
|
|
elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
|
|
consul-license: ${{secrets.CONSUL_LICENSE}}
|
2023-05-10 20:49:18 +00:00
|
|
|
datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
2023-03-28 21:29:27 +00:00
|
|
|
|
|
|
|
noop:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- run: "echo ok"
|
2023-04-06 22:29:32 +00:00
|
|
|
|
|
|
|
# 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
|
2023-07-12 23:10:34 +00:00
|
|
|
# - 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
|
2023-04-06 22:29:32 +00:00
|
|
|
# sure it does not get skipped.
|
|
|
|
|
|
|
|
go-tests-success:
|
2023-07-12 23:10:34 +00:00
|
|
|
needs:
|
2023-08-23 19:26:05 +00:00
|
|
|
- conditional-skip
|
2023-04-06 22:29:32 +00:00
|
|
|
- setup
|
2023-09-11 17:50:52 +00:00
|
|
|
- check-codegen
|
2023-04-06 22:29:32 +00:00
|
|
|
- check-generated-protobuf
|
|
|
|
- check-go-mod
|
|
|
|
- lint-consul-retry
|
|
|
|
- lint-container-test-deps
|
|
|
|
- lint-enums
|
|
|
|
- lint
|
|
|
|
- lint-32bit
|
|
|
|
# - go-test-arm64
|
|
|
|
- go-test-enterprise
|
2023-08-22 14:46:03 +00:00
|
|
|
- go-test-ce
|
2023-04-06 22:29:32 +00:00
|
|
|
- go-test-race
|
|
|
|
- go-test-envoyextensions
|
|
|
|
- go-test-troubleshoot
|
|
|
|
- go-test-api-1-19
|
|
|
|
- go-test-api-1-20
|
|
|
|
- go-test-sdk-1-19
|
|
|
|
- go-test-sdk-1-20
|
|
|
|
- go-test-32bit
|
2023-07-25 17:58:12 +00:00
|
|
|
# - go-test-s390x
|
2023-04-06 22:29:32 +00:00
|
|
|
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
|
2023-08-23 19:26:05 +00:00
|
|
|
if: always() && needs.conditional-skip.outputs.trigger-ci == 'true'
|
2023-04-06 22:29:32 +00:00
|
|
|
steps:
|
2023-04-25 20:17:48 +00:00
|
|
|
- name: evaluate upstream job results
|
|
|
|
run: |
|
|
|
|
# exit 1 if failure or cancelled result for any upstream job
|
|
|
|
if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then
|
|
|
|
printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}"
|
|
|
|
exit 1
|
|
|
|
fi
|