-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.19 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
name: Run unit tests
on:
push:
branches: [ master ]
paths-ignore:
- 'README.md'
pull_request:
branches: [ master ]
paths-ignore:
- 'README.md'
permissions:
contents: write
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
id: go
- name: Set up DB + Migrations
uses: hoverkraft-tech/compose-action@v2.1.0
with:
compose-file: "./docker-compose.infra.yaml"
down-flags: "--volumes"
- name: go test
run: make test-with-coverage
- name: check test coverage
uses: vladopajic/go-test-coverage@v2
with:
profile: cover.out
git-token: ${{ github.ref_name == 'master' && secrets.GITHUB_TOKEN || '' }}
# https://github.com/vladopajic/go-test-coverage/blob/main/docs/badge.md#hosting-the-coverage-badge-in-the-same-github-repository
## name of branch where badges are stored
## ideally this should be orphan branch (see below how to create this branch)
git-branch: badges