Skip to content

Improve GHA worklows #70

Improve GHA worklows

Improve GHA worklows #70

Workflow file for this run

name: 🔨 Build And Test
on:
push:
branches: [master]
pull_request:
branches: [master]
types: [opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Cache go mods
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: go get .
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
args: -c .golangci.yml --timeout=5m -v
- name: Build
run: go build -v ./...
- name: Test
run: go test -race -coverprofile=coverage.txt -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3