Skip to content

HashiCorp Terraform Compatibility Matrix #53

HashiCorp Terraform Compatibility Matrix

HashiCorp Terraform Compatibility Matrix #53

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@a5ac7e51b41094c92402da3b24376905380afc29
- 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 }}
slack-notification:
needs: ["run-test-supported-versions"]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- 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@70cd7be8e40a46e8b0eced40b0de447bdb42f68e
with:
payload: ${{ steps.slack-payload.outputs.slack_payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK