Repository navigation
69 lines (57 loc) · 1.82 KB
/
Copy pathci.yml
File metadata and controls
69 lines (57 loc) · 1.82 KB
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
name: CI
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Vet
run: go vet ./...
- name: Test
run: go test -race ./...
# The libdns test suite module needs a newer Go version than the provider itself.
- uses: actions/setup-go@v7
with:
go-version-file: libdnstest/go.mod
- name: Vet libdns test suite
working-directory: libdnstest
run: go vet ./...
# Runs the integration test against the real Domain Chief API.
# Needs the DOMAINCHIEF_TEST_ZONE repository variable and DOMAINCHIEF_API_TOKEN repository secret.
integration:
runs-on: ubuntu-latest
needs: test
if: github.event_name != 'pull_request'
concurrency:
group: integration
env:
DOMAINCHIEF_TEST_ZONE: ${{ vars.DOMAINCHIEF_TEST_ZONE }}
DOMAINCHIEF_API_TOKEN: ${{ secrets.DOMAINCHIEF_API_TOKEN }}
steps:
- name: Check configuration
id: configured
run: |
if [ -n "$DOMAINCHIEF_TEST_ZONE" ] && [ -n "$DOMAINCHIEF_API_TOKEN" ]; then
echo "ok=true" >> "$GITHUB_OUTPUT"
else
echo "::notice::Skipping integration tests, DOMAINCHIEF_TEST_ZONE or DOMAINCHIEF_API_TOKEN is not configured."
fi
- uses: actions/checkout@v7
if: steps.configured.outputs.ok == 'true'
- uses: actions/setup-go@v7
if: steps.configured.outputs.ok == 'true'
with:
go-version-file: go.mod
- name: Integration test
if: steps.configured.outputs.ok == 'true'
run: go test -count=1 -timeout 15m -run TestIntegration -v ./...