|
1 |
| -name: Dotcom Acceptance Tests |
| 1 | +name: Acceptance Tests (github.com) |
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + types: |
| 7 | + - opened |
| 8 | + - synchronize |
| 9 | + - reopened |
5 | 10 | branches:
|
6 |
| - - test/** |
| 11 | + - main |
7 | 12 |
|
8 |
| -jobs: |
| 13 | +permissions: read-all |
9 | 14 |
|
10 |
| - acceptance-tests-anonymous: |
| 15 | +jobs: |
| 16 | + test: |
| 17 | + name: Test ${{ matrix.type }} |
| 18 | + # if: contains(github.event.pull_request.labels.*.name, 'test') |
11 | 19 | runs-on: ubuntu-latest
|
| 20 | + permissions: |
| 21 | + contents: read |
| 22 | + defaults: |
| 23 | + run: |
| 24 | + shell: bash |
| 25 | + strategy: |
| 26 | + matrix: |
| 27 | + type: [anonymous, individual, organization] |
| 28 | + fail-fast: false |
12 | 29 | steps:
|
13 | 30 | - name: Checkout
|
14 | 31 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
15 |
| - with: |
16 |
| - ref: ${{ github.event.pull_request.head.ref }} |
17 |
| - fetch-depth: 2 |
18 |
| - - name: Acceptance Tests (Anonymous) |
19 |
| - uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 |
20 |
| - with: |
21 |
| - TF_LOG: INFO |
22 | 32 |
|
23 |
| - acceptance-tests-individual: |
24 |
| - runs-on: ubuntu-latest |
25 |
| - steps: |
26 |
| - - name: Checkout |
27 |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
28 |
| - with: |
29 |
| - ref: ${{ github.event.pull_request.head.ref }} |
30 |
| - fetch-depth: 2 |
31 |
| - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 |
| 33 | + - name: Set up Go |
| 34 | + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 |
32 | 35 | with:
|
33 |
| - go-version-file: 'go.mod' |
| 36 | + go-version-file: go.mod |
34 | 37 | cache: true
|
35 |
| - - name: Acceptance Tests (Individual) |
36 |
| - uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 |
37 |
| - with: |
38 |
| - TF_LOG: INFO |
39 |
| - GITHUB_OWNER: github-terraform-test-user |
40 |
| - GITHUB_TEST_USER_TOKEN: ${{ secrets.DOTCOM_TEST_USER_TOKEN }} |
41 |
| - GITHUB_TEST_ORGANIZATION: terraformtesting |
42 | 38 |
|
43 |
| - acceptance-tests-organization: |
44 |
| - runs-on: ubuntu-latest |
45 |
| - steps: |
46 |
| - - name: Checkout |
47 |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
48 |
| - with: |
49 |
| - ref: ${{ github.event.pull_request.head.ref }} |
50 |
| - fetch-depth: 2 |
51 |
| - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 |
52 |
| - with: |
53 |
| - go-version-file: 'go.mod' |
54 |
| - cache: true |
55 |
| - - name: Acceptance Tests (Organization) |
56 |
| - uses: terraformtesting/acceptance-tests@66f4842d934555dde0f59bf1a00abd0fc710ece4 # v2.2.0 |
57 |
| - with: |
| 39 | + - name: Run tests |
| 40 | + env: |
58 | 41 | TF_LOG: INFO
|
59 |
| - GITHUB_ORGANIZATION: terraformtesting |
60 |
| - GITHUB_TEST_USER_TOKEN: ${{ secrets.DOTCOM_TEST_USER_TOKEN }} |
61 |
| - GITHUB_TEST_OWNER: github-terraform-test-user |
| 42 | + GITHUB_OWNER: ${{ matrix.type == 'individual' && 'github-terraform-test-user' || '' }} |
| 43 | + GITHUB_TEST_ORGANIZATION: ${{ matrix.type == 'individual' && 'terraformtesting' || '' }} |
| 44 | + GITHUB_ORGANIZATION: ${{ matrix.type == 'organization' && 'terraformtesting' || '' }} |
| 45 | + GITHUB_TEST_OWNER: ${{ matrix.type == 'organization' && 'github-terraform-test-user' || '' }} |
| 46 | + GITHUB_TEST_USER_TOKEN: ${{ (matrix.type == 'individual' || matrix.type == 'organization') && secrets.DOTCOM_TEST_USER_TOKEN || '' }} |
| 47 | + run: make testacc |
0 commit comments