Skip to content

Go

Go #5

Workflow file for this run

name: Go
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- '*'
workflow_dispatch:
permissions:
contents: read
jobs:
unit-tests:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
max-parallel: 2
matrix:
go: ["1.20.x", "1.21.x"]
include:
- go: 1.21.x
latest: true
name: Unit Tests ${{ matrix.go }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Load cached dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: make deps
- name: Lint
if: matrix.latest
run: make lint
- name: Test
run: make unit