-
Notifications
You must be signed in to change notification settings - Fork 66
82 lines (72 loc) · 2.41 KB
/
integration-test.yml
File metadata and controls
82 lines (72 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: integration test
permissions:
pull-requests: read
contents: read
on:
push:
branches:
- master
pull_request:
jobs:
integration-test:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:7
ports:
- 27017:27017
mariadb:
image: mariadb:10.11
env:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: strfmt_integration_test
MARIADB_USER: strfmt_test
MARIADB_PASSWORD: strfmt_test
ports:
- 3306:3306
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=5
postgresql:
image: postgres:17
env:
POSTGRES_USER: strfmt_test
POSTGRES_PASSWORD: strfmt_test
POSTGRES_DB: strfmt_integration_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U strfmt_test -d strfmt_integration_test"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: stable
- name: Run integration tests
working-directory: internal/testintegration
env:
MONGODB_URI: mongodb://localhost:27017
MARIADB_DSN: "strfmt_test:strfmt_test@tcp(localhost:3306)/strfmt_integration_test?parseTime=true&loc=UTC"
POSTGRESQL_DSN: "postgres://strfmt_test:strfmt_test@localhost:5432/strfmt_integration_test?sslmode=disable"
run: >
go test -tags testintegration -v -count=1
-coverprofile='integration.coverage.ubuntu-latest-stable.out'
-covermode=atomic
-coverpkg='github.com/go-openapi/strfmt/...,github.com/go-openapi/strfmt/enable/mongodb/...'
./...
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
path: 'internal/testintegration/integration.coverage.ubuntu-latest-stable.out'
name: 'integration.coverage.ubuntu-latest-stable'
retention-days: 1
collect-coverage:
needs: [integration-test]
if: ${{ !cancelled() && needs.integration-test.result == 'success' }}
uses: go-openapi/ci-workflows/.github/workflows/collect-coverage.yml@34a5baa33361844b1d2c70cd4548e3cea83529d9 # v0.2.13
secrets: inherit