mirror of
https://github.com/nikoksr/notify.git
synced 2025-01-05 22:53:35 +02:00
059f8a6384
Remove build job from action, use native golangi-lint action, separate test and lint into separate jobs and add multiple versions and platforms to test matrix.
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
name: Test & Lint
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
jobs:
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
go-version: [1.16.x, 1.17.x]
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
- uses: actions/cache@v2
|
|
name: Prepare cache
|
|
with:
|
|
# In order:
|
|
# * Module download cache
|
|
# * Build cache (Linux)
|
|
# * Build cache (Mac)
|
|
# * Build cache (Windows)
|
|
path: |
|
|
~/go/pkg/mod
|
|
~/.cache/go-build
|
|
~/Library/Caches/go-build
|
|
%LocalAppData%\go-build
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
- name: Test
|
|
run: go test -failfast -race ./...
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Lint
|
|
uses: golangci/golangci-lint-action@v2
|