-
Notifications
You must be signed in to change notification settings - Fork 21
60 lines (55 loc) · 1.58 KB
/
bookkeeping.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Bookkeeping
on:
pull_request:
push:
branches:
- main
jobs:
coverage:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Start database
run: |
docker compose \
-f docker-compose.yml \
-f docker-compose.coverage.yml \
up --detach database
- name: Build test suite
run: |
docker compose \
-f docker-compose.yml \
-f docker-compose.coverage.yml \
build
- name: Wait for the database
run: |
docker compose \
-f docker-compose.yml \
-f docker-compose.coverage.yml \
run --rm application /opt/wait-for-it.sh -t 0 database:3306
- name: Execute test suite
run: |
docker compose \
-f docker-compose.yml \
-f docker-compose.test.yml \
run application npm run coverage
- name: Copy coverage from container
run: docker cp $(docker ps -aqlf "name=bookkeeping-application"):/usr/src/app/coverage/coverage-final.json .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
linter:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Installing dependencies
run: npm ci
- name: Running linter
run: npm run lint