-
Notifications
You must be signed in to change notification settings - Fork 9
87 lines (73 loc) · 2.26 KB
/
unit-tests.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
83
84
85
86
87
name: unit tests
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop, releases/** ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# TODO: add macos-latest
os: [ubuntu-latest]
python-version: [3.8, 3.9, "3.10", "3.11"]
exclude:
- os: macos-latest
python-version: [3.5, 3.6]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node
uses: actions/setup-node@v4
with:
# Obtain the latest cached version of npm (either local cache or action cache)
node-version: node
- name: Install Python3 dependencies
run: |
python -m pip install --upgrade pip pytest
pip install -r requirements.txt
python -m pip install --upgrade --force-reinstall git+https://github.com/LLNL/hatchet.git@develop
python setup.py install
python setup.py build_ext --inplace
python -m pip list
- name: Update Black
if: ${{ matrix.python-version == 3.8 }}
run: |
pip install flake8-pytest-importorskip
pip install --upgrade click==8.0.4
pip install black==21.12b0
pip install flake8==4.0.1
- name: Lint and Format Check with Flake8 and Black
if: ${{ matrix.python-version == 3.8 }}
run: |
black --diff --check .
flake8
- name: Check License Headers
run: |
python license.py verify
- name: Install ExtraP
if: ${{ matrix.python-version >= 3.7 }}
run: |
pip install extrap
- name: Install coverage tools
run: |
pip install codecov
pip install pytest-cov
- name: Basic Test with pytest
run: |
PYTHONPATH=. $(which pytest) --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.THICKET_CODECOV_TOKEN }}
with:
directory: ./coverage/reports/
env_vars: OS,PYTHON
files: /home/runner/work/thicket/thicket/coverage.xml
flags: unittests
verbose: true
fail_ci_if_error: true