-
Notifications
You must be signed in to change notification settings - Fork 20
114 lines (106 loc) · 3.37 KB
/
test.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Tests
on:
push:
branches: [main]
paths-ignore:
- 'README.md'
pull_request:
types: ['opened', 'synchronize']
paths:
- '**.go'
- 'vendor/**'
- '.github/workflows/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: .go-version
cache: true
- name: Get dependencies
run: go mod download
- name: Build
run: go build -v .
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: .go-version
cache: true
- run: go generate ./...
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
test:
name: Terraform Provider Acceptance Tests
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
terraform:
- '1.0.*'
- '1.1.*'
- '1.2.*'
- '1.4.*'
include:
- terraform: '1.0.*'
domain: 'dnsimple-1-0-terraform.bio'
registrant_change_domain: '6xjh9macv560eydj0frnloi0v1sgz1i1wcxsytjqt9pmo4y8vq21n2h8sqm4zu.eu'
- terraform: '1.1.*'
domain: 'dnsimple-1-1-terraform.bio'
registrant_change_domain: '6e640p3gc3yoh1szlntwhxvkk23f8jo8q7a64kuoghepq0q77iyg0nyqnc7nap.eu'
- terraform: '1.2.*'
domain: 'dnsimple-1-2-terraform.bio'
registrant_change_domain: '56gz94oqngp5xb82a04ugewpbv80hqj72kc8p3o3gd550esemiv2bzhjhoihs8.eu'
- terraform: '1.4.*'
domain: 'dnsimple-1-4-terraform.bio'
registrant_change_domain: '3177iktacmv2bg05lkvgsmpoysq5i1vniu6glxl6kq4picv5lvlj2blexwi6bw.eu'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: .go-version
cache: true
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- run: go mod download
- env:
TF_ACC: "1"
DNSIMPLE_SANDBOX: true
DNSIMPLE_ACCOUNT: ${{ secrets.DNSIMPLE_ACCOUNT }}
DNSIMPLE_TOKEN: ${{ secrets.DNSIMPLE_TOKEN }}
DNSIMPLE_DOMAIN: ${{ matrix.domain }}
DNSIMPLE_CONTACT_ID: ${{ secrets.DNSIMPLE_CONTACT_ID }}
DNSIMPLE_REGISTRANT_CHANGE_DOMAIN: ${{ matrix.registrant_change_domain }}
DNSIMPLE_REGISTRANT_CHANGE_CONTACT_ID: 10854
run: go test -v -cover ./internal/... -timeout 15m
timeout-minutes: 10
slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL_DEVELOPMENT}}