2020-07-31 12:25:24 +02:00
|
|
|
name: test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
go:
|
2020-08-13 14:03:16 +02:00
|
|
|
env:
|
|
|
|
MAXMIND_GEOLITE2_LICENSE: ${{ secrets.MAXMIND_GEOLITE2_LICENSE }}
|
2020-07-31 12:25:24 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
go-version:
|
|
|
|
- "1.13"
|
|
|
|
- "1.14"
|
2020-08-28 17:06:18 +02:00
|
|
|
- "1.15"
|
2021-04-09 16:34:54 +02:00
|
|
|
- "1.16"
|
2020-07-31 12:25:24 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-05-12 08:18:11 +02:00
|
|
|
- uses: actions/checkout@v2.3.4
|
2020-07-31 12:25:24 +02:00
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
|
|
|
|
- name: Cache dependencies
|
2021-05-28 08:26:41 +02:00
|
|
|
uses: actions/cache@v2.1.6
|
2020-07-31 12:25:24 +02:00
|
|
|
with:
|
|
|
|
path: vendor/
|
2021-04-09 16:15:00 +02:00
|
|
|
key: vendor-${{ matrix.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
|
2020-07-31 12:25:24 +02:00
|
|
|
|
|
|
|
- name: Build applications
|
|
|
|
run: |
|
2021-01-05 08:58:53 +01:00
|
|
|
echo "Building with $(nproc) threads"
|
|
|
|
make client -j$(nproc)
|
|
|
|
make proxy -j$(nproc)
|
|
|
|
make server -j$(nproc)
|
2020-07-31 12:25:24 +02:00
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
make test || make test
|
|
|
|
|
|
|
|
- name: Generate coverage report
|
|
|
|
run: |
|
|
|
|
make cover || make cover
|
2020-07-31 16:33:20 +02:00
|
|
|
|
|
|
|
- name: Convert coverage to lcov
|
2021-04-27 10:35:35 +02:00
|
|
|
uses: jandelgado/gcov2lcov-action@v1.0.8
|
2020-07-31 16:33:20 +02:00
|
|
|
with:
|
|
|
|
infile: cover.out
|
|
|
|
outfile: cover.lcov
|
|
|
|
|
|
|
|
- name: Coveralls Parallel
|
2021-04-27 10:35:32 +02:00
|
|
|
uses: coverallsapp/github-action@v1.1.2
|
2020-07-31 16:42:04 +02:00
|
|
|
env:
|
|
|
|
COVERALLS_FLAG_NAME: run-${{ matrix.go-version }}
|
2020-07-31 16:33:20 +02:00
|
|
|
with:
|
|
|
|
path-to-lcov: cover.lcov
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
parallel: true
|
|
|
|
|
|
|
|
finish:
|
|
|
|
needs: go
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Coveralls Finished
|
2021-04-27 10:35:32 +02:00
|
|
|
uses: coverallsapp/github-action@v1.1.2
|
2020-07-31 16:33:20 +02:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
parallel-finished: true
|