dotfiles/.github/workflows/go.yml

59 lines
1.2 KiB
YAML

name: Go
on:
push:
branches:
- main
paths:
- "**.go"
- "go.mod"
- "go.sum"
pull_request:
branches:
- main
paths:
- "**.go"
- "go.mod"
- "go.sum"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "stable"
- run: go test -race -coverprofile=coverage.out ./...
- uses: codecov/codecov-action@v3
with:
files: coverage.out
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "stable"
- run: go build ./cmd/dot
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "stable"
- uses: golangci/golangci-lint-action@v3
with:
version: latest