1
0
mirror of https://github.com/nikoksr/notify.git synced 2025-01-20 02:59:56 +02:00

ci(action): update github action

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.
This commit is contained in:
Niko Köser 2021-11-17 16:21:33 +01:00
parent 984f1e5e83
commit 059f8a6384
No known key found for this signature in database
GPG Key ID: F3F28C118DAA6375

View File

@ -1,4 +1,4 @@
name: CI
name: Test & Lint
on:
push:
tags:
@ -7,16 +7,40 @@ on:
- main
pull_request:
jobs:
golangci:
name: Lint, Test & Build
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
with:
version: latest
- name: Test
run: make test
- name: Build
run: go build -v ./...