Skip to content

fix tests

fix tests #112

Workflow file for this run

name: Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
test:
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
stable: false
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Set up dependencies
run: go mod download
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
- name: Unit Tests
run: go test -race -v $(go list ./... | grep -v /test/) -coverprofile=unit.out
- name: Functional Tests
run: go test -p 1 -race ./test/functional/... -coverpkg ./internal/... -coverprofile=functional.out
- name: Merge coverage profile
run: |
go install github.com/wadey/gocovmerge@latest
gocovmerge unit.out functional.out > coverage.out
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out
flag-name: Go-${{ matrix.go }}
parallel: true
test-cache:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Unit Tests
run: go test -race -v $(go list ./... | grep -v /test/)
- name: Functional Tests
run: go test -list -race ./test/functional/...
finish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true