-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (66 loc) · 1.88 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
steps:
- uses: actions/checkout@v3
- name: Python ${{ matrix.python-version }} Setup
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
pip install poetry
if [ -d /poetryenvs ]; then rm -rf ~/poetryenvs; fi
poetry config virtualenvs.path ~/poetryenvs
poetry install
- name: Run flake8
run: |
poetry run pflake8 cado --config pyproject.toml
poetry run pflake8 tests --config pyproject.toml
- name: Run pylint
run: |
poetry run pylint cado --rcfile pyproject.toml
- name: Run mypy
run: |
poetry run mypy cado --config pyproject.toml
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: cado/ui/yarn.lock
- name: Install UI dependencies
run: yarn install
working-directory: cado/ui
- name: Build UI bundle
run: yarn build
working-directory: cado/ui
- name: Run pytest
run: |
poetry run pytest tests --cov=cado --cov-report=html --cov-report=xml --cov-branch
- name: Upload HTML Coverage
uses: actions/upload-artifact@v2
with:
name: cado-coverage-html
path: htmlcov
- name: Upload XML Coverage
uses: actions/upload-artifact@v2
with:
name: cado-coverage-xml
path: coverage.xml
- name: Check Coverage
run: |
poetry run covcheck coverage.xml --config pyproject.toml