31791ba4dc
The default GitHub Action is write which is not required for this action.
35 lines
970 B
YAML
35 lines
970 B
YAML
name: Build and Test
|
|
on: [push, pull_request]
|
|
jobs:
|
|
build:
|
|
# https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/
|
|
permissions:
|
|
contents: read
|
|
name: Go CI
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go: [1.16.8, 1.17.1]
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
- name: Check out source
|
|
uses: actions/checkout@v2
|
|
- name: Install Linters
|
|
run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.26.0"
|
|
- name: Build
|
|
env:
|
|
GO111MODULE: "on"
|
|
run: go build ./...
|
|
- name: Test
|
|
env:
|
|
GO111MODULE: "on"
|
|
run: |
|
|
sh ./goclean.sh
|
|
|
|
- name: Send coverage
|
|
uses: shogo82148/actions-goveralls@v1
|
|
with:
|
|
path-to-profile: profile.cov
|