|
1 | 1 | name: 'Test Suite'
|
2 | 2 |
|
3 |
| -# Runs acceptance and migrations tests with a set of terraform versions and provider versions (used for migration tests). This worflow is scheduled daily except Saturdays, but can also be run manually. |
| 3 | +# Runs acceptance and migrations tests with a set of terraform versions and provider versions (used for migration tests). |
| 4 | +# This worflow is scheduled daily and runs against dev every day except for Sunday when we run against QA. It can also be run manually. |
| 5 | +# The 1st day of the month we run terraform-compatibility-matrix.yml and therefore, we skip the test-suite (see shedule->cron below). |
4 | 6 | on:
|
5 | 7 | workflow_dispatch:
|
6 | 8 | inputs:
|
|
33 | 35 | default: true
|
34 | 36 |
|
35 | 37 | schedule:
|
36 |
| - # https://crontab.guru/#0_0_2-31_*_0 |
37 |
| - - cron: "0 0 2-31 * 1-6" # workflow runs at 00:00 on every day-of-month from 2 through 31 and on every day-of-week from Monday through Saturday. |
38 |
| - - cron: "0 0 2-31 * 0" # workflow runs at 00:00 on every day-of-month from 2 through 31 and on Sunday. |
39 |
| - |
| 38 | + - cron: "0 0 2-31 * *" # workflow runs every day at midnight UTC except on the first day of the month |
40 | 39 | concurrency:
|
41 | 40 | group: '${{ github.workflow }}'
|
42 | 41 | cancel-in-progress: false
|
43 | 42 |
|
44 | 43 | jobs:
|
45 |
| - versions: |
| 44 | + variables: |
46 | 45 | env:
|
47 | 46 | schedule_terraform_matrix: '["${{ vars.TF_VERSION_LATEST }}"]'
|
48 | 47 | schedule_provider_matrix: '[""]' # "" for latest version
|
49 | 48 | runs-on: ubuntu-latest
|
50 | 49 | outputs:
|
51 | 50 | terraform_matrix: ${{ inputs.terraform_matrix || env.schedule_terraform_matrix }}
|
52 | 51 | provider_matrix: ${{ inputs.provider_matrix || env.schedule_provider_matrix }}
|
| 52 | + day: ${{ steps.set_day.outputs.DAY }} |
53 | 53 | steps:
|
54 |
| - - if: false |
55 |
| - run: echo jobs need steps |
56 |
| - |
| 54 | + - name: set day |
| 55 | + id: set_day |
| 56 | + run: | |
| 57 | + echo "DAY=$(date +'%a')" |
| 58 | + echo "DAY=$(date +'%a')" >> "$GITHUB_OUTPUT" |
57 | 59 | clean-before:
|
58 | 60 | secrets: inherit
|
59 | 61 | uses: ./.github/workflows/cleanup-test-env.yml
|
60 | 62 |
|
61 | 63 | tests:
|
62 |
| - needs: [clean-before, versions] |
| 64 | + needs: [clean-before, variables] |
63 | 65 | if: ${{ !cancelled() }}
|
64 | 66 | strategy:
|
65 | 67 | max-parallel: 1
|
66 | 68 | fail-fast: false
|
67 | 69 | matrix:
|
68 |
| - terraform_version: ${{ fromJSON(needs.versions.outputs.terraform_matrix) }} |
69 |
| - provider_version: ${{ fromJSON(needs.versions.outputs.provider_matrix) }} |
| 70 | + terraform_version: ${{ fromJSON(needs.variables.outputs.terraform_matrix) }} |
| 71 | + provider_version: ${{ fromJSON(needs.variables.outputs.provider_matrix) }} |
70 | 72 | name: tests-${{ matrix.terraform_version || 'latest' }}-${{ matrix.provider_version || 'latest' }}
|
71 | 73 | secrets: inherit
|
72 | 74 | uses: ./.github/workflows/acceptance-tests.yml
|
73 | 75 | with:
|
74 | 76 | terraform_version: ${{ matrix.terraform_version }}
|
75 | 77 | provider_version: ${{ matrix.provider_version }}
|
76 |
| - atlas_cloud_env: ${{ inputs.atlas_cloud_env || github.event.schedule == '0 0 2-31 * 0' && 'qa' || 'dev' }} |
| 78 | + atlas_cloud_env: ${{ inputs.atlas_cloud_env || needs.variables.outputs.day == 'Sun' && 'qa' }} |
77 | 79 |
|
78 | 80 | clean-after:
|
79 | 81 | needs: tests
|
|
0 commit comments