Add Github Actions CI (#27)

This commit is contained in:
Phil Porada 2021-11-17 14:15:26 -05:00 committed by GitHub
parent 1b0abc3709
commit 6cd7580102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 40 additions and 0 deletions

40
.github/workflows/test.yaml vendored Normal file
View File

@ -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