-
Notifications
You must be signed in to change notification settings - Fork 769
77 lines (67 loc) · 2.26 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Acceptance Tests (github.com)
on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- main
permissions: read-all
jobs:
test:
name: Test ${{ matrix.mode }}
# if: contains(github.event.pull_request.labels.*.name, 'acctest')
# environment:
# name: dotcom
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
mode: [anonymous, individual, organization] # team, 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.mode != 'anonymous'
id: credentials
run: |
set -eou pipefail
token="${{ secrets.DOTCOM_TEST_USER_TOKEN }}"
if [[ -z "${token}" ]]; then
echo "Missing credentials" >&2
exit 1
fi
echo "token=${token}" >> "${GITHUB_OUTPUT}"
- name: Run tests
env:
TF_ACC: "1"
TF_LOG: INFO
TESTARGS: "-race -coverprofile=coverage.txt -covermode=atomic -sweep=tf-acc-"
GITHUB_BASE_URL: https://api.github.com/
GITHUB_TEST_TYPE: ${{ matrix.mode }}
GITHUB_OWNER: ${{ (matrix.mode == 'individual' && 'github-terraform-test-user') || (matrix.mode == 'organization' && 'terraformtesting') || '' }}
GITHUB_USERNAME: github-terraform-test-user
GITHUB_TOKEN: ${{ matrix.mode != 'anonymous' && steps.credentials.outputs.token || '' }}
GITHUB_ENTERPRISE_SLUG: ""
GITHUB_TEST_USER_REPOSITORY: test-xk24f
GITHUB_TEST_ORG_USER: ""
GITHUB_TEST_ORG_REPOSITORY: test-repo
GITHUB_TEST_ORG_TEMPLATE_REPOSITORY: terraform-template-module
GITHUB_TEST_ORG_APP_INSTALLATION_ID: ""
GITHUB_TEST_EXTERNAL_USER: ""
GITHUB_TEST_EXTERNAL_USER_TOKEN: ""
GITHUB_TEST_EXTERNAL_USER2: ""
GITHUB_TEST_ADVANCED_SECURITY: "true"
run: make testacc