2021-10-29 04:39:57 +02:00
|
|
|
name: Units tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
checks:
|
|
|
|
name: test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-11-13 19:45:21 +01:00
|
|
|
- uses: actions/checkout@v3.6.0
|
2021-10-29 04:39:57 +02:00
|
|
|
- name: Setup go
|
2023-05-23 23:29:21 +02:00
|
|
|
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
|
2021-10-29 04:39:57 +02:00
|
|
|
with:
|
2022-09-08 00:14:30 +02:00
|
|
|
go-version: 1.19
|
2023-05-13 04:27:45 +02:00
|
|
|
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
|
2021-10-29 05:27:51 +02:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/go/pkg/mod
|
|
|
|
~/.cache/go-build
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
2021-10-29 04:39:57 +02:00
|
|
|
- name: Run tests
|
|
|
|
run: go test -v -covermode=count -coverprofile=coverage.out
|
|
|
|
- name: Convert coverage to lcov
|
2022-09-08 00:45:43 +02:00
|
|
|
uses: jandelgado/gcov2lcov-action@c680c0f7c7442485f1749eb2a13e54a686e76eb5
|
2021-10-29 04:39:57 +02:00
|
|
|
- name: Coveralls
|
2023-11-13 19:45:36 +01:00
|
|
|
uses: coverallsapp/github-action@95b1a2355bd0e526ad2fd62da9fd386ad4c98474
|
2021-10-29 04:39:57 +02:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
path-to-lcov: coverage.lcov
|