Skip to content

Commit

Permalink
chore: Runs tests for latest minor versions of each major TF version (#…
Browse files Browse the repository at this point in the history
…1769)

* concurrency group

* add terraform version to asdf

* TEMPORARY - show terraform version

* Revert "TEMPORARY - show terraform version"

This reverts commit 74312c2.

* define versions to run

* versions job

* typo

* TEMPORARY - fail linter

* Revert "TEMPORARY - fail linter"

This reverts commit 5f82991.

* Update .github/workflows/test-suite.yml

Co-authored-by: Agustin Bettati <bettatiagustin@gmail.com>

---------

Co-authored-by: Agustin Bettati <bettatiagustin@gmail.com>
  • Loading branch information
lantoli and AgustinBettati authored Dec 19, 2023
1 parent d8643b3 commit 480a64f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,47 @@ name: 'Test Suite'

on:
workflow_dispatch:
inputs:
terraform_matrix:
description: 'Terraform version matrix (JSON array)'
default: '["1.6.x", "1.5.x", "1.4.x", "1.3.x", "1.2.x"]'
provider_matrix:
description: 'MongoDB Atlas Provider version matrix for running migration tests (JSON array)'
default: '["", "1.12.3"]' # "" for latest version

schedule:
- cron: "0 0 * * *" # workflow runs every day at midnight UTC


concurrency:
group: '${{ github.workflow }}'
cancel-in-progress: false

jobs:
versions:
env:
schedule_terraform_matrix: '["1.6.x", "1.0.8"]'
schedule_provider_matrix: '["", "1.12.3]' # "" for latest version
runs-on: ubuntu-latest
outputs:
terraform_matrix: ${{ inputs.terraform_matrix || vars.schedule_terraform_matrix }}
provider_matrix: ${{ inputs.provider_matrix || vars.schedule_provider_matrix }}
steps:
- if: false
run: echo jobs need steps

clean-before:
secrets: inherit
uses: ./.github/workflows/cleanup-test-env.yml

mig-tests:
needs: clean-before
needs: [clean-before, versions]
if: ${{ !cancelled() }}
strategy:
max-parallel: 1
fail-fast: false
matrix:
terraform_version: ['', '1.0.8'] # '' for latest version
provider_version: ['', '1.11.1'] # '' for latest version
terraform_version: ${{ fromJSON(needs.versions.outputs.terraform_matrix) }}
provider_version: ${{ fromJSON(needs.versions.outputs.provider_matrix) }}
name: mig-tests-${{ matrix.terraform_version || 'latest' }}-${{ matrix.provider_version || 'latest' }}
secrets: inherit
uses: ./.github/workflows/migration-tests.yml
Expand All @@ -28,13 +51,13 @@ jobs:
provider_version: ${{ matrix.provider_version }}

acc-tests:
needs: mig-tests
needs: [mig-tests, versions]
if: ${{ !cancelled() }}
strategy:
max-parallel: 1
fail-fast: false
matrix:
terraform_version: ['', '1.0.8'] # '' for latest version
terraform_version: ${{ fromJSON(needs.versions.outputs.terraform_matrix) }}
name: acc-tests-${{ matrix.terraform_version || 'latest' }}
secrets: inherit
uses: ./.github/workflows/acceptance-tests.yml
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
golang 1.21.3
terraform 1.6.6

0 comments on commit 480a64f

Please sign in to comment.