forked from vmware/terraform-provider-wavefront
73 lines (68 loc) · 1.96 KB
/
release.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
name: Release
on:
push:
tags: [ v* ]
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
# Permission for checking out code
contents: read
jobs:
unit:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.18.x", "1.19.x", "1.20.x"]
steps:
- uses: actions/checkout@v3
- run: make test
acceptance:
name: Acceptance Tests
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.18.x", "1.19.x", "1.20.x"]
fail-fast: true
max-parallel: 1
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: '1.4.*'
terraform_wrapper: false
- run: make testacc
goreleaser:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.18.x", "1.19.x", "1.20.x"]
steps:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without a patch version:
# we always use the latest patch version.
version: v1.52
# Optional: if set to `true` then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
skip-cache: true
- name: Run gofmt
run: diff -u <(echo -n) <(gofmt -d .)
- name: Run go vet
run: go vet ./
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v2
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --release-header .goreleaser.tmpl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}