-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1885 from tisnik/consumers-coverage
Consumers-only tests on CI
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Go tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
gotests: | ||
env: | ||
TEST_TO_RUN: ./consumer | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
go-version: | ||
- "1.18" | ||
- "1.19" | ||
- "1.20" | ||
- "1.21" | ||
name: Consumers tests for Go ${{ matrix.go-version}} | ||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Print env vars | ||
run: env | ||
- name: Unit tests | ||
run: make test | ||
- name: Check code coverage | ||
run: ./check_coverage.sh | ||
- name: Display code coverage | ||
run: make coverage |