Use github actions for CI

This commit is contained in:
Christoph Petrausch
2020-04-21 22:18:14 +02:00
parent 1de13bc192
commit 7eb393e433
4 changed files with 60 additions and 33 deletions

10
.github/workflows/linting.yml vendored Normal file
View File

@@ -0,0 +1,10 @@
on: [push, pull_request]
name: linting
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run golangci-lint
uses: actions-contrib/golangci-lint@v1

30
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: release
on:
push:
tags:
- '*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14.x
- name: Test
run: go test ./...
- name: Vet
run: go vet ./...
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

20
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
on: [push, pull_request]
name: tests
jobs:
test:
strategy:
matrix:
go-version: [1.13.x, 1.14.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: go test ./...
- name: Vet
run: go vet ./...