-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 951 Bytes
/
unit-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
name: unit-test
on:
push:
branches:
- main
pull_request:
jobs:
unit-test:
name: Unit test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup goose
run: |
curl -fsSL \
https://raw.githubusercontent.com/pressly/goose/master/install.sh | sh -s v3.5.3
- name: Setup containers
run: |
cp ./go/.env.test ./go/.env
docker network create coffee_app_default
docker-compose up -d
docker run --network coffee_app_default jwilder/dockerize -wait tcp://mysql:3306 -timeout 3m
make migrate-up DB_NAME=coffee_app_test
- name: Run tests
run: |
make go-test options="-coverprofile=coverage.out -covermode=atomic -coverpkg=./..."
- name: Upload coverages
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}