-
Notifications
You must be signed in to change notification settings - Fork 8
60 lines (57 loc) · 1.9 KB
/
checkpoint.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: checkpoint-tests
on:
push:
paths:
- "checkpoint/**"
jobs:
checkpoint_lint_and_test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: checkpoint
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Cache Python Env
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: checkpoint-${{ env.pythonLocation }}-${{ hashFiles('checkpoint/requirements-dev.txt') }}-${{ hashFiles('checkpoint/setup.py') }}
restore-keys: |
checkpoint-${{ env.pythonLocation }}-${{ hashFiles('checkpoint/requirements-dev.txt') }}
checkpoint-${{ env.pythonLocation }}-
- name: Cache MyPy
uses: actions/cache@v2
with:
path: checkpoint/.mypy_cache
key: checkpoint-mypy-${{ hashFiles('checkpoint/**') }}
restore-keys: |
checkpoint-mypy-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -r requirements-dev.txt
pip install --upgrade --upgrade-strategy eager -e .
- name: Lint project with black
run: |
black --check --diff .
- name: Lint application with flake8
run: |
flake8 checkpoint --count --show-source --statistics
- name: Check application with mypy
run: |
mypy checkpoint
- name: Lint tests with flake8
run: |
flake8 tests --count --show-source --statistics
- name: Check tests with mypy
run: |
mypy tests
- name: Test with pytest
run: |
python -m pytest