-
Notifications
You must be signed in to change notification settings - Fork 8
91 lines (74 loc) · 2.52 KB
/
ci.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
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
86
87
88
89
90
91
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Setup Python 🐍
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Poetry
uses: snok/install-poetry@5e4414407e59f94f2148bcb253917dfc22dee7d9
with:
virtualenvs-in-project: false
virtualenvs-path: ~/.cache/poetry/virtualenvs
- uses: actions/cache@v1
name: Cache Poetry deps
with:
path: ~/.cache/pypoetry/virtualenvs
key: lint-${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
lint-${{ runner.os }}-poetry-
- name: Install Dependencies
run: poetry install -v
if: steps.cache.outputs.cache-hit != 'true'
- name: Check the code quality
run: POETRY=poetry make check-code-quality
- name: Check if the code is correctly typed
run: POETRY=poetry make check-types
Tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }} 🐍
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@5e4414407e59f94f2148bcb253917dfc22dee7d9
with:
virtualenvs-in-project: false
virtualenvs-path: ~/.cache/poetry/virtualenvs
- uses: actions/cache@v1
name: Cache Poetry deps
with:
path: ~/.cache/pypoetry/virtualenvs
key: tests-${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
tests-${{ runner.os }}-${{ matrix.python-version }}-poetry-
- name: Install Dependencies
run: poetry install -v
if: steps.cache.outputs.cache-hit != 'true'
- name: Run the test suite
run: POETRY=poetry make test
- name: Upload coverage to Codecov
if: matrix.python-version == 3.8
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
yml: codecov.yml
fail_ci_if_error: true