2021-10-29 04:39:57 +02:00
|
|
|
name: Units tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
checks:
|
|
|
|
name: test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-06-27 23:43:55 +02:00
|
|
|
- uses: actions/checkout@v4.1.6
|
2021-10-29 04:39:57 +02:00
|
|
|
- name: Setup go
|
2024-01-11 20:30:17 +01:00
|
|
|
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
|
2021-10-29 04:39:57 +02:00
|
|
|
with:
|
2022-09-08 00:14:30 +02:00
|
|
|
go-version: 1.19
|
2024-02-14 23:45:40 +01:00
|
|
|
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2
|
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
|
2024-01-11 20:30:55 +01:00
|
|
|
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949
|
2021-10-29 04:39:57 +02:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
path-to-lcov: coverage.lcov
|