forked from digitalocean/packer-plugin-digitalocean
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.23 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
name: Tests
on:
pull_request:
push:
branches:
- main
jobs:
test:
strategy:
matrix:
go-version: [1.20.x, 1.21.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Restore cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Ensure code is formatted with gofmt
run: make check-fmt
if: matrix.os == 'ubuntu-latest'
- name: Ensure generated code was recreated if needed
run: make check-generate
if: matrix.os == 'ubuntu-latest'
- name: Lint with golangci-lint
uses: golangci/golangci-lint-action@v3
with:
only-new-issues: true
if: matrix.os == 'ubuntu-latest'
- name: Run unit tests
run: make test
- name: Verify plugin binary works with Packer
run: make plugin-check
if: matrix.os == 'ubuntu-latest'