Skip to content

build(deps): Bump actions/cache from 2 to 4 #3

build(deps): Bump actions/cache from 2 to 4

build(deps): Bump actions/cache from 2 to 4 #3

Workflow file for this run

name: Go unit tests
on:
pull_request:
types: [ opened, edited, reopened, synchronize ]
push:
branches:
- master
workflow_dispatch:
jobs:
test:
strategy:
matrix:
go-version: [ 1.21.x, 1.22.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Restore cache
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Gofmt
working-directory: ${{ github.workspace }}/src
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ];
then
gofmt -w .
git diff
exit 1
fi
if: matrix.os == 'ubuntu-latest'
- name: Build
working-directory: ${{ github.workspace }}/src
run: go build -v ./...
- name: Test
working-directory: ${{ github.workspace }}/src
run: go test -v ./...