From 6cd75801025dbbaa78ae6748ba1b1b1eb049c002 Mon Sep 17 00:00:00 2001 From: Phil Porada Date: Wed, 17 Nov 2021 14:15:26 -0500 Subject: [PATCH] Add Github Actions CI (#27) --- .github/workflows/test.yaml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..aa21481 --- /dev/null +++ b/.github/workflows/test.yaml @@ -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