-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (44 loc) · 1.11 KB
/
go-test.yaml
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: Go Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17.2
ports:
- 5433:5432
env:
POSTGRES_DB: maek_test
POSTGRES_USER: maek
POSTGRES_PASSWORD: passwd
options: >-
--health-cmd="pg_isready -U maek"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
CONFIG_FILE: ${{ github.workspace }}/config/config.toml
CGO_ENABLED: '0'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go 1.23.1
uses: actions/setup-go@v5
with:
go-version: 1.23.1
- name: Install dependencies
run: go mod tidy
- name: Run Tests with coverage
run: go test -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: karngyan/maek