Skip to content

Add cache step.

Add cache step. #143

Workflow file for this run

name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go:
- '1.22'
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '${{ matrix.go }}'
check-latest: true
- name: Cache modules
uses: actions/cache@v4
with:
path: |
~/go/pkg
key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod', '**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: go build -v ./...
- name: Test
run: ./test.sh