Skip to content

Cache fix

Cache fix #65

Workflow file for this run

name: Go
on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- main
release:
types:
- published
env:
IS_PR: ${{github.event_name == 'pull_request' || ''}}
IS_MAIN: ${{github.event_name == 'push' || ''}}
IS_RELEASE: ${{github.event_name == 'release' || ''}}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-go-cache
path: |
~/.cache/golangci-lint
~/.cache/go-build
~/go/pkg/mod
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Install dependencies
run: go mod download
- name: Lint
run: make lint
- name: Test
run: make test
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./junit.xml
- uses: actions/cache/save@v4
if: ${{ env.IS_MAIN }}
with:
key: ${{ runner.os }}-go-cache
path: |
~/.cache/golangci-lint
~/.cache/go-build
~/go/pkg/mod