-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 1.67 KB
/
Copy pathsrv.test.yaml
File metadata and controls
58 lines (56 loc) · 1.67 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
name: srv-test
on:
workflow_call:
inputs:
go_version:
type: string
default: '1.24.2'
working_directory:
type: string
default: '.'
jobs:
integration-test:
name: Run integration tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working_directory}}
services:
psql:
image: postgres:17
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go_version }}
cache-dependency-path: ${{ inputs.working_directory}}/go.sum
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Install tern
run: go install github.com/jackc/tern/v2@latest
- name: Run migrations
run: tern migrate -m migrations -c migrations/tern.conf
- name: Run tests
run: gotestsum --format pkgname-and-test-fails -- -race --count=1 --tags=integration ./...
unit-test:
name: Run unit tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working_directory}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go_version }}
cache-dependency-path: ${{ inputs.working_directory}}/go.sum
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Run tests
run: gotestsum --format pkgname-and-test-fails -- -race --count=1 --tags=unit ./...