-
Notifications
You must be signed in to change notification settings - Fork 9.6k
45 lines (40 loc) · 1.4 KB
/
crt-hook-equivalence-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: crt-hook-equivalence-tests
on:
repository_dispatch:
types:
- crt-hook-equivalence-tests::terraform::*
permissions:
contents: write
jobs:
parse-metadata:
name: "Parse metadata.json"
runs-on: ubuntu-latest
outputs:
version: ${{ steps.parse.outputs.version }}
target-branch: ${{ steps.parse.outputs.target-branch }}
steps:
- name: parse
id: parse
env:
METADATA_PAYLOAD: ${{ toJSON(github.event.client_payload.payload) }}
run: |
VERSION=$(echo ${METADATA_PAYLOAD} | jq -r '.version')
TARGET_BRANCH=$(./.github/scripts/equivalence-test.sh get-target-branch "$VERSION")
echo "target-branch=$TARGET_BRANCH" >> "GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
run-equivalence-tests:
runs-on: ubuntu-latest
name: "Run equivalence tests"
needs:
- parse-metadata
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ needs.parse-metadata.outputs.target-branch }}
- uses: ./.github/actions/equivalence-test
with:
target-terraform-version: ${{ needs.parse-metadata.outputs.version }}
target-terraform-branch: ${{ needs.parse-metadata.outputs.target-branch }}
target-equivalence-test-version: 0.3.0
target-os: linux
target-arch: amd64