Skip to content

Add Coveralls step in GH actions #4

Add Coveralls step in GH actions

Add Coveralls step in GH actions #4

Workflow file for this run

name: build
on: ["push", "pull_request"]
env:
GO_VERSION: "1.19"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: setup go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- uses: golangci/golangci-lint-action@v3
with:
args: -v
build:
name: build
runs-on: ubuntu-latest
steps:
- name: set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Build
run: make build-bin
test:
name: test
runs-on: ubuntu-latest
steps:
- name: setup go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Test
run: make test
coverage:
runs-on: ubuntu-latest
needs: build
name: coverage
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Go test with coverage
run: sudo make test-coverage # sudo needed for network interfaces creation
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: test/coverage/lcov.info