Add Github Actions CI (#27)
This commit is contained in:
parent
1b0abc3709
commit
6cd7580102
|
@ -0,0 +1,40 @@
|
|||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
GO111MODULE: "auto"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.16.x, 1.17.x]
|
||||
os: [ubuntu-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
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v2
|
||||
with:
|
||||
version: latest
|
||||
- name: go coverage
|
||||
run: |
|
||||
go test -mod=readonly -v -race -covermode=atomic -coverprofile=coverage.out ./...
|
||||
- uses: codecov/codecov-action@v2
|
||||
if: success()
|
||||
with:
|
||||
file: ./coverage.out
|
||||
flags: unbound_exporter_tests
|
||||
name: unbound_exporter tests
|
Loading…
Reference in New Issue