test: normalize job and steps between build and release test workflows (#18425)

Signed-off-by: Ryan Cragun <me@ryan.ec>
This commit is contained in:
Ryan Cragun 2022-12-15 16:10:49 -07:00 committed by GitHub
parent caf8f83cd4
commit ebbbcf7e5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -7,18 +7,20 @@ on:
- enos-release-testing-oss::* - enos-release-testing-oss::*
jobs: jobs:
metadata: product-metadata:
if: ${{ startsWith(github.event.client_payload.payload.branch, 'release/') }} if: ${{ startsWith(github.event.client_payload.payload.branch, 'release/') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
matrix-test-group: ${{ steps.matrix-group.outputs.matrix-test-group }} matrix-test-group: ${{ steps.get-metadata.outputs.matrix-test-group }}
vault-revision: ${{ steps.get-metadata.outputs.vault-revision }} vault-revision: ${{ steps.get-metadata.outputs.vault-revision }}
vault-version: ${{ steps.get-metadata.outputs.vault-version }} vault-version: ${{ steps.get-metadata.outputs.vault-version }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
# Check out the repository at the same Git SHA that was used to create
# the artifacts to get the correct metadata.
ref: ${{ github.event.client_payload.payload.sha }} ref: ${{ github.event.client_payload.payload.sha }}
- id: matrix-group - id: get-metadata
env: env:
# MATRIX_MAX_TEST_GROUPS is required to determine the randomly selected # MATRIX_MAX_TEST_GROUPS is required to determine the randomly selected
# test group. It should be set to the highest test_group used in the # test group. It should be set to the highest test_group used in the
@ -32,7 +34,7 @@ jobs:
test: test:
name: Test ${{ matrix.build-artifact-name }} name: Test ${{ matrix.build-artifact-name }}
if: ${{ startsWith(github.event.client_payload.payload.branch, 'release/') }} if: ${{ startsWith(github.event.client_payload.payload.branch, 'release/') }}
needs: metadata needs: product-metadata
uses: ./.github/workflows/enos-run.yml uses: ./.github/workflows/enos-run.yml
strategy: strategy:
fail-fast: false fail-fast: false
@ -45,7 +47,7 @@ jobs:
with: with:
build-artifact-name: ${{ matrix.build-artifact-name }} build-artifact-name: ${{ matrix.build-artifact-name }}
matrix-file-name: ${{ matrix.matrix-file-name }} matrix-file-name: ${{ matrix.matrix-file-name }}
matrix-test-group: ${{ needs.metadata.outputs.matrix-test-group }} matrix-test-group: ${{ needs.product-metadata.outputs.matrix-test-group }}
vault-edition: oss vault-edition: oss
vault-revision: ${{ needs.product-metadata.outputs.vault-revision }} vault-revision: ${{ needs.product-metadata.outputs.vault-revision }}
secrets: inherit secrets: inherit