Skip to content

Merge pull request #107 from digitalocean/asb/go1-21 #97

Merge pull request #107 from digitalocean/asb/go1-21

Merge pull request #107 from digitalocean/asb/go1-21 #97

Workflow file for this run

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'