-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (47 loc) · 1.23 KB
/
test.yml
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
name: test
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
test:
name: test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 10s
--health-retries 5
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
container: golang:1.21
steps:
- uses: actions/checkout@v3
- name: test
run: make mod test coverage
env:
TEST_DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable&pool_max_conns=8
TEST_REDIS_URL: redis:6379
- name: upload results
uses: actions/upload-artifact@v3
with:
name: Upload test coverage
path: tmp/coverage
- name: function coverage
run: make func-coverage