| 1 |
name: Units tests |
| 2 |
on: [push, pull_request] |
| 3 |
jobs: |
| 4 |
checks: |
| 5 |
name: test |
| 6 |
runs-on: ubuntu-latest |
| 7 |
steps: |
| 8 |
- uses: actions/checkout@61b9e3751b92087fd0b06925ba6dd6314e06f089 |
| 9 |
- name: Setup go |
| 10 |
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f |
| 11 |
with: |
| 12 |
go-version: 1.19 |
| 13 |
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 |
| 14 |
with: |
| 15 |
path: | |
| 16 |
~/go/pkg/mod |
| 17 |
~/.cache/go-build |
| 18 |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 19 |
restore-keys: | |
| 20 |
${{ runner.os }}-go- |
| 21 |
- name: Run tests |
| 22 |
run: go test -v -covermode=count -coverprofile=coverage.out |
| 23 |
- name: Convert coverage to lcov |
| 24 |
uses: jandelgado/gcov2lcov-action@c680c0f7c7442485f1749eb2a13e54a686e76eb5 |
| 25 |
- name: Coveralls |
| 26 |
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 |
| 27 |
with: |
| 28 |
github-token: ${{ secrets.github_token }} |
| 29 |
path-to-lcov: coverage.lcov |