-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (50 loc) · 1.24 KB
/
test.yml
File metadata and controls
57 lines (50 loc) · 1.24 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
name: Test
# This workflow will run on main branch and on any pull requests targeting main
on:
push:
branches:
- main
paths:
- '.github/workflows/test.yml'
- 'cmd/**'
- 'src/**'
pull_request:
workflow_dispatch:
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 1.24
id: go
- name: Checkout code
uses: actions/checkout@v6
- name: Test
run: |
make test-coverage
env:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Send coverage report to Coveralls
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=coverage.txt -service=github
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_PORT: 5432
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5