-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (131 loc) · 3.68 KB
/
ci.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
name: CI
on: [push]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
checks: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
env:
VERBOSE: "true"
lint-provider:
name: Lint Provider
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Run tfproviderlint
run: make lint-provider
tidy:
name: Tidy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Check if mods are tidy
run: make check-tidy
test:
name: Acceptance Test (VCR Replay)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
terraform_version:
- "" # latest
- "1.8.5"
- "1.7.5"
- "1.6.6"
- "1.5.7"
- "1.4.7"
- "1.3.10"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ matrix.terraform_version }}
terraform_wrapper: false
- name: Run tests
run: make testacc
env:
VERBOSE: "true"
VCR: "replay"
KATAPULT_API_KEY: ${{ secrets.KATAPULT_API_KEY }}
KATAPULT_ORGANIZATION: ${{ secrets.KATAPULT_ORGANIZATION }}
KATAPULT_DATA_CENTER: ${{ secrets.KATAPULT_DATA_CENTER }}
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Validate documentation
run: make check-docs
- name: Ensure generated documentation is up to date
run: mv docs docs-current && make docs && diff -rN docs-current docs
release-please:
name: Release Please
runs-on: ubuntu-latest
needs: [lint, lint-provider, tidy, test, docs]
if: github.ref == 'refs/heads/main'
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }}
version: ${{ steps.release-please.outputs.version }}
permissions:
contents: write
pull-requests: write
steps:
- uses: krystal/release-please-manifest-action@v1
id: release-please
with:
app-id: ${{ vars.RELEASE_PLEASE_GITHUB_APP_ID }}
private-key: ${{ secrets.RELEASE_PLEASE_GITHUB_APP_PRIVATE_KEY }}
release:
name: Release
runs-on: ubuntu-latest
needs: [release-please]
if: needs.release-please.outputs.release_created
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: "${{ secrets.GPG_PRIVATE_KEY }}"
passphrase: "${{ secrets.PASSPHRASE }}"
- name: goreleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GPG_FINGERPRINT: "${{ steps.import_gpg.outputs.fingerprint }}"