-
Notifications
You must be signed in to change notification settings - Fork 178
74 lines (67 loc) · 2.79 KB
/
terraform-compatibility-matrix.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: "HashiCorp Terraform Compatibility Matrix"
run-name: 'HashiCorp Terraform Compatibility Matrix ${{ inputs.atlas_cloud_env }}'
on:
schedule:
- cron: "0 0 1 * *" # runs first day of the month at midnight UTC
workflow_dispatch:
inputs:
atlas_cloud_env:
description: 'Atlas cloud environment used, can be either `dev` or `qa`, empty for `dev`. Migration tests will always use `dev`'
type: string
required: false
test_group:
description: 'Test group to run, e.g. advanced_cluster, empty for all'
type: string
required: false
jobs:
get-supported-versions:
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Get HashiCorp Terraform supported versions
shell: bash
id: get-terraform-supported-versions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
output=$(./scripts/get-terraform-supported-versions.sh "false")
quoted_output=$(echo "${output}" | jq -c .)
echo "supported_versions=${quoted_output}" >> "${GITHUB_OUTPUT}"
outputs:
supported_versions: ${{ steps.get-terraform-supported-versions.outputs.supported_versions }}
run-test-supported-versions:
needs: ["get-supported-versions"]
if: ${{ !cancelled() }}
strategy:
max-parallel: 1
fail-fast: false
matrix:
terraform_version: '${{ fromJSON(needs.get-supported-versions.outputs.supported_versions) }}'
name: terrafrom-compatibility-${{ matrix.terraform_version }}-${{ inputs.atlas_cloud_env || 'dev' }}
secrets: inherit
uses: ./.github/workflows/test-suite.yml
with:
terraform_matrix: '["${{ matrix.terraform_version }}"]'
atlas_cloud_env: ${{ inputs.atlas_cloud_env || 'dev' }}
send_notification: false
slack-notification:
needs: ["run-test-supported-versions"]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Get content of slack message
id: slack-payload
run: |
slack_message=$(./scripts/generate-slack-notification-content.sh ${{ needs.run-test-supported-versions.result }} ${{ secrets.SLACK_ONCALL_TAG }} ${{github.server_url}} ${{github.repository}} ${{github.run_id}})
echo "slack_payload=${slack_message}" >> "${GITHUB_OUTPUT}"
- name: Send Slack message
id: slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0
with:
payload: ${{ steps.slack-payload.outputs.slack_payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK