-
Notifications
You must be signed in to change notification settings - Fork 65
85 lines (80 loc) · 2.46 KB
/
ci.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
name: CI
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
setup-venv:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: syphar/restore-virtualenv@v1.3
id: venv-cache
- uses: abatilo/actions-poetry@v2.4.0
if: steps.setup-venv.outputs.cache-hit != 'true'
- name: Install Python dependencies
run: poetry install -vv
if: steps.setup-venv.outputs.cache-hit != 'true'
backend-build:
runs-on: ubuntu-latest
needs: setup-venv
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: syphar/restore-virtualenv@v1.3
id: venv-cache
- run: poetry run flake8
- run: poetry run black --check .
- run: poetry run pyre --noninteractive
- run: poetry run green --run-coverage
- run: poetry run coverage xml -o backend-coverage.xml
- uses: actions/upload-artifact@v2
if: matrix.python-version == '3.8'
with:
name: backend-coverage
path: backend-coverage.xml
frontend-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: yarn install
- run: yarn lint
- run: yarn run prettier --check src
- run: yarn run tsc
- run: yarn build
- run: yarn test --coverage --collectCoverageFrom "src/**/*"
- run: mv coverage/coverage-final.json ../frontend-coverage.json
- uses: actions/upload-artifact@v2
with:
name: frontend-coverage
path: frontend-coverage.json
codecov:
runs-on: ubuntu-latest
needs: [backend-build, frontend-build]
steps:
- uses: actions/checkout@v2
- name: Retrieve backend test coverage
uses: actions/download-artifact@v2
with:
name: backend-coverage
- name: Retrieve frontend test coverage
uses: actions/download-artifact@v2
with:
name: frontend-coverage
- uses: codecov/codecov-action@v2
with:
files: ./backend-coverage.xml,./frontend-coverage.json