diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 70e6ef7..9e8b95a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -28,7 +28,7 @@ jobs: timeout-minutes: 10 strategy: matrix: - go-version: [ 1.18, 1.19 ] + go-version: [ '1.19', '1.20', '1.21' ] steps: - uses: actions/checkout@v3 diff --git a/Taskfile.yaml b/Taskfile.yaml index b3ef2d0..5832af8 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -10,6 +10,9 @@ tasks: cmds: - task: test-deps-up - task: test-run + - task: test-run + vars: + RACE: true - task: test-deps-down test-deps-up: @@ -28,7 +31,7 @@ tasks: test-run: summary: Runs tests, must have dependencies running in the docker-compose cmds: - - cmd: go test -timeout 2m -cover -coverprofile=coverage.txt -covermode=atomic ./... + - cmd: go test {{if .RACE}} -race {{end}} -timeout 2m -cover -coverprofile=coverage.txt -covermode=atomic ./... vars: PG_PQ_HOST: sh: docker-compose port pg-pq 5432 @@ -56,6 +59,7 @@ tasks: sh: docker-compose port nats 4222 env: + CGO_ENABLED: '{{if .RACE}}1{{else}}0{{end}}' HEALTH_GO_PG_PQ_DSN: 'postgres://test:test@{{.PG_PQ_HOST}}/test?sslmode=disable' HEALTH_GO_PG_PGX4_DSN: 'postgres://test:test@{{.PG_PGX4_HOST}}/test?sslmode=disable' HEALTH_GO_PG_PGX5_DSN: 'postgres://test:test@{{.PG_PGX5_HOST}}/test?sslmode=disable'