2021-11-17 19:15:26 +00:00
|
|
|
name: test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
env:
|
|
|
|
GO111MODULE: "auto"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-11-14 02:34:00 +00:00
|
|
|
go-version:
|
|
|
|
- 1.20.x
|
|
|
|
- 1.21.x
|
2021-11-17 19:15:26 +00:00
|
|
|
os: [ubuntu-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Install Go
|
2023-11-14 02:34:00 +00:00
|
|
|
uses: actions/setup-go@v4
|
2021-11-17 19:15:26 +00:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Checkout code
|
2023-11-14 02:34:00 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-11-17 19:15:26 +00:00
|
|
|
- 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 ./...
|
2023-11-14 02:34:00 +00:00
|
|
|
- uses: codecov/codecov-action@v3
|
2021-11-17 19:15:26 +00:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
file: ./coverage.out
|
|
|
|
flags: unbound_exporter_tests
|
|
|
|
name: unbound_exporter tests
|