Nightly test-integrations 1.19.x #62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) HashiCorp, Inc. | |
# SPDX-License-Identifier: MPL-2.0 | |
name: Nightly test-integrations 1.19.x | |
on: | |
schedule: | |
# Run nightly at 1AM UTC/9PM EST/6PM PST | |
- cron: '0 1 * * *' | |
workflow_dispatch: {} | |
env: | |
TEST_RESULTS_DIR: /tmp/test-results | |
TEST_RESULTS_ARTIFACT_NAME: test-results | |
CONSUL_LICENSE: ${{ secrets.CONSUL_LICENSE }} | |
GOTAGS: ${{ endsWith(github.repository, '-enterprise') && 'consulent' || '' }} | |
GOTESTSUM_VERSION: "1.11.0" | |
CONSUL_BINARY_UPLOAD_NAME: consul-bin | |
# strip the hashicorp/ off the front of github.repository for consul | |
CONSUL_LATEST_IMAGE_NAME: ${{ endsWith(github.repository, '-enterprise') && github.repository || 'hashicorp/consul' }} | |
GOPRIVATE: github.com/hashicorp # Required for enterprise deps | |
BRANCH: "release/1.19.x" | |
BRANCH_NAME: "release-1.19.x" # Used for naming artifacts | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
name: Setup | |
outputs: | |
compute-small: ${{ steps.runners.outputs.compute-small }} | |
compute-medium: ${{ steps.runners.outputs.compute-medium }} | |
compute-large: ${{ steps.runners.outputs.compute-large }} | |
compute-xl: ${{ steps.runners.outputs.compute-xl }} | |
enterprise: ${{ steps.runners.outputs.enterprise }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
ref: ${{ env.BRANCH }} | |
- id: runners | |
run: .github/scripts/get_runner_classes.sh | |
get-go-version: | |
uses: ./.github/workflows/reusable-get-go-version.yml | |
with: | |
ref: release/1.19.x | |
get-envoy-versions: | |
uses: ./.github/workflows/reusable-get-envoy-versions.yml | |
with: | |
ref: zalimeni/net-5622-consolidate-envoy-version-mgmt-1.19 | |
generate-envoy-job-matrices: | |
needs: [setup] | |
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} | |
name: Generate Envoy Job Matrices | |
outputs: | |
envoy-matrix: ${{ steps.set-matrix.outputs.envoy-matrix }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
ref: ${{ env.BRANCH }} | |
- name: Generate Envoy Job Matrix | |
id: set-matrix | |
env: | |
# TEST_SPLITS sets the number of test case splits to use in the matrix. This will be | |
# further multiplied in envoy-integration tests by the other dimensions in the matrix | |
# to determine the total number of runners used. | |
TEST_SPLITS: 4 | |
JQ_SLICER: '[ inputs ] | [_nwise(length / $runnercount | floor)]' | |
run: | | |
NUM_DIRS=$(find ./test/integration/connect/envoy -mindepth 1 -maxdepth 1 -type d | wc -l) | |
if [ "$NUM_DIRS" -lt "$TEST_SPLITS" ]; then | |
echo "TEST_SPLITS is larger than the number of tests/packages to split." | |
TEST_SPLITS=$((NUM_DIRS-1)) | |
fi | |
# fix issue where test splitting calculation generates 1 more split than TEST_SPLITS. | |
TEST_SPLITS=$((TEST_SPLITS-1)) | |
{ | |
echo -n "envoy-matrix=" | |
find ./test/integration/connect/envoy -maxdepth 1 -type d -print0 \ | |
| xargs -0 -n 1 basename \ | |
| jq --raw-input --argjson runnercount "$TEST_SPLITS" "$JQ_SLICER" \ | |
| jq --compact-output 'map(join("|"))' | |
} >> "$GITHUB_OUTPUT" | |
test-envoy-versions: | |
runs-on: ubuntu-latest | |
needs: | |
- get-envoy-versions | |
- generate-envoy-job-matrices | |
steps: | |
- name: Test Envoy Versions | |
run: | | |
echo "envoy-versions-json=${{ needs.get-envoy-versions.outputs.envoy-versions-json }}" | |
echo "${{ needs.get-envoy-versions.outputs.envoy-versions-json }}" | jq -r '.[]' | while read -r version; do | |
echo "Found Envoy version $version" | |
done | |
echo "envoy-versions-json=${{ needs.generate-envoy-job-matrices.outputs.envoy-matrix }}" | |
echo "${{ needs.generate-envoy-job-matrices.outputs.envoy-matrix }}" | jq -r '.[]' | while read -r tests; do | |
echo "Tests $tests" | |
done | |
envoy-integration-test: | |
runs-on: ${{ fromJSON(needs.setup.outputs.compute-large) }} | |
needs: | |
- setup | |
- get-go-version | |
- get-envoy-versions | |
- generate-envoy-job-matrices | |
permissions: | |
id-token: write # NOTE: this permission is explicitly required for Vault auth. | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
envoy-version: ${{ fromJSON(needs.get-envoy-versions.outputs.envoy-versions-json) }} | |
xds-target: ["server", "client"] | |
test-cases: ${{ fromJSON(needs.generate-envoy-job-matrices.outputs.envoy-matrix) }} | |
env: | |
ENVOY_VERSION: ${{ matrix.envoy-version }} | |
XDS_TARGET: ${{ matrix.xds-target }} | |
AWS_LAMBDA_REGION: us-west-2 | |
steps: | |
- name: debug | |
run: echo 'Envoy version ${{ matrix.envoy-version }}' |