30 lines
802 B
YAML
30 lines
802 B
YAML
name: Units tests
|
|
on: [push, pull_request]
|
|
jobs:
|
|
checks:
|
|
name: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Setup go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.17
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/go/pkg/mod
|
|
~/.cache/go-build
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
- name: Run tests
|
|
run: go test -v -covermode=count -coverprofile=coverage.out
|
|
- name: Convert coverage to lcov
|
|
uses: jandelgado/gcov2lcov-action@v1.0.8
|
|
- name: Coveralls
|
|
uses: coverallsapp/github-action@v1.1.2
|
|
with:
|
|
github-token: ${{ secrets.github_token }}
|
|
path-to-lcov: coverage.lcov
|