-
Notifications
You must be signed in to change notification settings - Fork 75
71 lines (64 loc) · 1.82 KB
/
test.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: test
on:
pull_request:
jobs:
integration_tests:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Unshallow
run: git fetch --prune --unshallow
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: v1.5.x
terraform_wrapper: false
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: HCLOUD_TOKEN
env:
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
run: |
echo "HCLOUD_TOKEN=$HCLOUD_TOKEN" >> "$GITHUB_ENV"
- uses: hetznercloud/tps-action@main
if: ${{ vars.USE_TPS }}
- name: check HCLOUD_TOKEN
run: |
if [[ "${HCLOUD_TOKEN:-}" == "" ]]; then
echo "::error ::Couldn't determine HCLOUD_TOKEN. Are repository secrets correctly set?"
exit 1
fi
- name: Run tests
env:
# Domain must be available in the account running the tests. This domain is available in the account
# running the public integration tests.
CERT_DOMAIN: hc-integrations-test.de
# Debug Logs
TF_LOG: DEBUG
TF_LOG_PATH: test.log
run: |
make testacc
make
- uses: actions/upload-artifact@v3
if: always() # Also run if the tests failed
with:
name: debug-logs
path: internal/e2etests/**/test.log
unit_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run tests
run: |
make test