Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

chore(deps): update actions/checkout action to v4 #161

chore(deps): update actions/checkout action to v4

chore(deps): update actions/checkout action to v4 #161

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Cache go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Run go fmt
if: runner.os != 'Windows'
run: diff -u <(echo -n) <(gofmt -d -s .)
- name: Run go generate
if: runner.os != 'Windows'
run: diff -u <(echo -n) <(go generate ./...)
- name: Run go vet
run: go vet ./...
test:
name: Test
strategy:
matrix:
go-version: [1.x, 1.16.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Cache go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Run go test
run: go test -v -race -coverprofile profile.cov -covermode atomic ./...
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov