-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1.08 KB
/
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
on: [push, pull_request]
name: test
jobs:
test:
strategy:
matrix:
go-version: [1.18.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Run db background
run: docker-compose -f stack.yaml -f stack.dev.yaml up -d
- name: Load data in db
run: |
cat structure/schema.sql | docker exec -i db psql -h localhost -U postgres -d postgres \
&& docker exec db psql -h localhost -U postgres -d postgres -c "\dt+"
- name: Exec tests
run: |
export APP_POSTGRES_PASSWORD=${{ secrets.APP_POSTGRES_PASSWORD }} \
&& cd api/accounts && go test -v -coverprofile=coverage.txt -covermode=atomic || true
- name: Upload coverage report
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_API_KEY }}
file: ./api/accounts/coverage.txt
flags: unittests
name: codecov-umbrella