-
Notifications
You must be signed in to change notification settings - Fork 18
76 lines (71 loc) · 1.99 KB
/
default.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
name: default
on:
push:
concurrency:
group: default
cancel-in-progress: false
permissions:
contents: write
jobs:
validate:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
- name: Format code
run: go fmt ./...
- name: Generate docs
run: go run github.com/hashicorp/terraform-plugin-docs/cmd/[email protected]
- name: Check if any files have changed
run: test -z "$(git status --porcelain)" || ( git diff && exit 1 )
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
- name: Run unit tests
run: go test -v ./...
- name: Run acceptance tests
env:
TF_ACC: 'yup'
UPTIME_TOKEN: '${{ secrets.UPTIME_TOKEN }}'
run: go test -v ./... -run ^TestAcc[A-Z]
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
needs:
- validate
- test
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # history is required for goreleaser to work
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
id: import_gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean
version: "~> v2"
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}