-
Notifications
You must be signed in to change notification settings - Fork 772
55 lines (48 loc) · 1.52 KB
/
ghes-acceptance-tests.yml
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
name: Acceptance Tests (GHES)
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, 'test')
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
shell: bash
strategy:
matrix:
type: [anonymous, individual, organization]
fail-fast: false
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 server address
run: |
address="$(dig +short terraformtesting-ghe.eastus.cloudapp.azure.com)"
if [[ "${address}" == ""]]; then
echo "Invalid server address" >&2
exit 1
fi
- name: Run tests
env:
TF_LOG: INFO
GITHUB_BASE_URL: https://terraformtesting-ghe.eastus.cloudapp.azure.com/
GITHUB_OWNER: ${{ matrix.type == 'individual' && 'administrator' || '' }}
GITHUB_ORGANIZATION: ${{ matrix.type == 'organization' && 'terraformtesting' || '' }}
GITHUB_TEST_USER_TOKEN: ${{ (matrix.type == 'individual' || matrix.type == 'organization') && secrets.GHES_TEST_USER_TOKEN || '' }}
run: make testacc