Skip to content

Merge pull request #157 from digitalocean/dependabot/go_modules/githu… #199

Merge pull request #157 from digitalocean/dependabot/go_modules/githu…

Merge pull request #157 from digitalocean/dependabot/go_modules/githu… #199

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- main
jobs:
test:
strategy:
matrix:
go-version: [1.21.x, 1.22.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
if: matrix.os == 'ubuntu-latest'
run: make lint
- name: Run unit tests
run: make test
- name: Verify plugin binary works with Packer
run: make plugin-check
if: matrix.os == 'ubuntu-latest'