Run CI's checks, the server tests and the other Go tests as three parallel jobs, without coverage

The server package's race run takes about as long as all other packages together, so it gets its own job. Coverage was only printed to the log, and its instrumentation slowed the race run.
This commit is contained in:
binwiederhier committed 2026-11-01 23:54:10 +00:00
1 parent c3e6b542b5
commit d6b510dc46
1 file changed
+13 -3
+13 -3
View File
@@ -5,7 +5,12 @@ on:
pull_request:
jobs:
test:
name: test (${{ matrix.part }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
part: [checks, server, rest] # In parallel: the server package takes as long as all others together
services:
postgres:
image: postgres:17
@@ -44,6 +49,11 @@ jobs:
- name: Build web app (required for tests)
run: make web
- name: Run web tests, formatting, vetting and linting
run: make web-test web-fmt-check fmt-check vet web-lint lint staticcheck template-check go-check # The Go tests run once, with -race, in coverage
- name: Run Go tests (race detector, coverage)
run: make coverage
if: matrix.part == 'checks'
run: make web-test web-fmt-check fmt-check vet web-lint lint staticcheck template-check go-check
- name: Run Go tests of the server package (race detector)
if: matrix.part == 'server'
run: go test -race ./server
- name: Run Go tests of all other packages (race detector)
if: matrix.part == 'rest'
run: go test -race $(go list -f '{{if or .TestGoFiles .XTestGoFiles}}{{.ImportPath}}{{end}}' ./... | grep -vE 'ntfy/v2/(test|examples|tools|web|server)$')