HashiCorp Terraform Compatibility Matrix #36
Workflow file for this run
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
name: "HashiCorp Terraform Compatibility Matrix" | |
run-name: 'HashiCorp Terraform Compatibility Matrix ${{ inputs.atlas_cloud_env }}' | |
on: | |
pull_request: | |
types: [synchronize] | |
schedule: | |
- cron: "0 0 1 * *" # runs first Saturday 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 | |
steps: | |
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | |
- 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) | |
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' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: test-${{ matrix.terraform_version }} | |
run: | | |
echo "test-${{ matrix.terraform_version }}" | |
slack-notification: | |
needs: ["run-test-supported-versions"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | |
- name: Get content of slack message | |
id: slack-payload | |
run: | | |
slack_message=$(./scripts/generate-slack-notification-content.sh ${{ needs.run-test-supported-versions.result }} ${{github.server_url}} ${{github.repository}} ${{github.run_id}} ) | |
echo "slack_payload=${slack_message}" >> "${GITHUB_OUTPUT}"" | |
- name: Send Slack message | |
id: slack | |
uses: slackapi/[email protected] | |
with: | |
payload: ${{ steps.slack-payload.outputs.slack_payload }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |