-
Notifications
You must be signed in to change notification settings - Fork 769
60 lines (54 loc) · 1.72 KB
/
dotcom-acceptance-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Acceptance Tests (github.com)
on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- main
permissions: read-all
jobs:
test:
name: Test ${{ matrix.type }}
# if: contains(github.event.pull_request.labels.*.name, 'acctest')
# environment:
# name: dotcom
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
type: [anonymous, individual, organization, enterprise]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set-up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
cache: true
- name: Check credentials
if: matrix.type != 'anonymous'
run: |
if [[ -z "${{ secrets.DOTCOM_TEST_USER_TOKEN }}" ]]; then
echo "Missing credentials" >&2
exit 1
fi
- name: Run tests
env:
TF_LOG: INFO
GITHUB_BASE_URL: https://api.github.com/
GITHUB_TEST_ORGANIZATION: terraformtesting
GITHUB_TEST_OWNER: github-terraform-test-user
GITHUB_TEMPLATE_REPOSITORY: terraform-template-module
GITHUB_TEMPLATE_REPOSITORY_RELEASE_ID: "25117183"
GITHUB_OWNER: ${{ matrix.type == 'individual' && 'github-terraform-test-user' || '' }}
GITHUB_ORGANIZATION: ${{ matrix.type == 'organization' && 'terraformtesting' || '' }}
GITHUB_TOKEN: ${{ matrix.type != 'anonymous' && secrets.DOTCOM_TEST_USER_TOKEN || '' }}
run: make testacc