1
0
mirror of https://github.com/nikoksr/notify.git synced 2025-02-13 13:18:35 +02:00

Merge pull request #169 from nikoksr/ci/update-github-action

ci(action): update github action
This commit is contained in:
Niko Köser 2021-11-17 16:27:32 +01:00 committed by GitHub
commit 5893741874
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 ./...