-
Notifications
You must be signed in to change notification settings - Fork 9
71 lines (68 loc) · 1.83 KB
/
test.yml
File metadata and controls
71 lines (68 loc) · 1.83 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
name: Test Suite
on:
pull_request:
types:
- opened
pull_request_target:
types:
- opened
push:
branches:
- '*'
permissions:
contents: write
actions: write
pull-requests: write
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest] # , macos-15
go-version: ['1.26.0']
runs-on: ${{ matrix.os }}
env:
TL_TEST_DATABASE_URL: postgres://root:for_testing@localhost:5432/tlv2_test?sslmode=disable
TL_TEST_SERVER_DATABASE_URL: postgres://root:for_testing@localhost:5432/tlv2_test_server?sslmode=disable
TL_REDIS_URL: redis://localhost
services:
postgres:
image: postgis/postgis:16-3.4-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: for_testing
POSTGRES_DB: tlv2_test_server
options: >-
--health-cmd "pg_isready -U root -d tlv2_test_server"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7.4.0-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
id: go
- run: (cd cmd/transitland && go version && go install .)
- run: ./testdata/test_setup.sh
- name: Run tests
run: go test -coverprofile c.out ./...
- name: Produce coverage report
run: go tool cover -html=c.out -o coverage.html
- name: Save coverage report as artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}
path: coverage.html