-
Notifications
You must be signed in to change notification settings - Fork 17
88 lines (80 loc) · 2.21 KB
/
tests.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
name: tests
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8"]
env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pip install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install mdbenchmark
run: poetry install --extras docs
- name: Check reformat
run: poetry run make reformat-check
- name: Check style
run: poetry run make flake8
- name: Check sort
run: poetry run make isort-check
- name: Check reStructuredText
run: poetry run make rst-lint
- name: Unit-tests
run: poetry run pytest -v --cov=mdbenchmark --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
env_vars: PYTHON
fail_ci_if_error: true
- name: Build distribution
run: poetry build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dists.${{ matrix.python-version }}
path: dist/
- name: Make docs
run: |
cd docs
poetry run make build
test-build:
runs-on: ubuntu-latest
needs: test
strategy:
matrix:
python-version: ["3.7", "3.8"]
steps:
- name: Enable pip-caching
run: touch requirements.txt
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' #doesn't seem to work
- name: Update pip
run: pip install --upgrade pip
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dists.${{ matrix.python-version }}
path: dist
- name: Install mdbenchmark
run: pip install dist/*.tar.gz
- name: Check run
run: mdbenchmark