-
Notifications
You must be signed in to change notification settings - Fork 21
64 lines (52 loc) · 1.44 KB
/
build.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
name: Build
on:
push:
pull_request:
types: [ opened, reopened, ready_for_review, synchronize ]
jobs:
codestyle-unit-tests:
runs-on: ubuntu-20.04
container:
image: python:3.8.10-slim
steps:
- uses: actions/checkout@v3
- name: Install make
run: |
apt-get update
apt-get install -y make
- name: Load cached virtual environment
uses: actions/cache@v2
id: cache
with:
path: ~/venv/
key: v0.1.0-build-${{ hashFiles('setup.py') }}
- name: Create virtual environment on cache miss
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m venv ~/venv && . ~/venv/bin/activate
pip install --upgrade pip!=21.3
pip install -e .[dev]
- name: Run black check
run: |
. ~/venv/bin/activate
make check-black
- name: Run ruff check
run: |
. ~/venv/bin/activate
make check-ruff
- name: Run mypy check
run: |
. ~/venv/bin/activate
make mypy
- name: Run unit tests
run: |
. ~/venv/bin/activate
make ci-unit-tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage-unit.xml
flags: unit
fail_ci_if_error: true
verbose: true