forked from terraform-coop/terraform-provider-foreman
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 1.55 KB
/
test.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
name: Test
on:
pull_request:
branches:
- master
paths:
- '**.go'
- '.github/workflows/*.yml'
jobs:
test:
strategy:
matrix:
go-version: ['>=1.21','>=1.22']
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Run go code tests
run: go test ./... -v -covermode=count
- name: Compile terraform provider binary
run: go build
- name: Install terraform
uses: hashicorp/setup-terraform@v3
- name: Test provider integrity
run: terraform plan -input=false -no-color
working-directory: ./examples/verify_provider
env:
TF_CLI_CONFIG_FILE: tfoverriderc
buildtest:
runs-on: ubuntu-latest
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v3
with:
go-version: '>=1.22'
- name: Checkout code
uses: actions/checkout@v3
- name: Run GoReleaser Test
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean --snapshot --skip sign
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: ${{ github.run_id }}
path: |
dist/terraform-provider-foreman*
!dist/*.zip
retention-days: 3
overwrite: true