-
Notifications
You must be signed in to change notification settings - Fork 6
66 lines (55 loc) · 1.66 KB
/
Copy pathgo.yml
File metadata and controls
66 lines (55 loc) · 1.66 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
name: Go
on:
push:
branches: [master, main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- name: Verify formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "These files need gofmt:"
echo "$unformatted"
exit 1
fi
- name: Vet
run: go vet ./...
- name: Unit tests
run: go test -race -coverprofile=coverage.out ./...
- name: Coverage summary
run: go tool cover -func=coverage.out | tail -1
# The conformance suite creates and deletes real records, so it only runs
# when a test zone is configured. Forks and PRs from forks skip it.
conformance:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- name: libdns conformance suite
env:
NJALLA_API_TOKEN: ${{ secrets.NJALLA_API_TOKEN }}
NJALLA_TEST_ZONE: ${{ secrets.NJALLA_TEST_ZONE }}
run: |
if [ -z "$NJALLA_API_TOKEN" ] || [ -z "$NJALLA_TEST_ZONE" ]; then
echo "NJALLA_API_TOKEN / NJALLA_TEST_ZONE not configured; skipping."
exit 0
fi
cd libdnstest
go test -v ./...