Skip to content

Renovate Update actions/cache action to v4 #53

Renovate Update actions/cache action to v4

Renovate Update actions/cache action to v4 #53

Workflow file for this run

name: Test
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.22'
- name: Cache modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install modules
run: |
go mod download
- name: Setup gotestsum
uses: autero1/[email protected]
with:
gotestsum_version: 1.6.4
- run: mkdir -p /tmp/test-results
- name: Run Tests
run: |
gotestsum --junitfile /tmp/test-results/unit-tests.xml -- ./... -coverprofile=/tmp/test-coverage.txt
- name: Upload Code Coverage
uses: codecov/codecov-action@v1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: /tmp/test-coverage.txt
fail_ci_if_error: true
verbose: true