-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (61 loc) · 1.88 KB
/
test.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
name: Run Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
formatting:
name: Check Formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Formatting
run: |
python -m pip install --upgrade pip
pip install hacking isort
- name: Check Formatting
run: |
flake8 .
grep -rlIP '[^\x00-\x7F]' rcb4 | grep '\.pyx\?' | sort > unicode.out; grep -rlI '# -\*- coding: \(utf-8\|latin-1\) -\*-' rcb4 | grep '\.pyx\?' | sort > coding.out; comm -23 unicode.out coding.out > test_code.out; cat test_code.out; test \! -s test_code.out
- name: Check isort
run: |
isort -c .
tests:
name: Run Unit Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [self-hosted]
python-version: [3.8, 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python for Self-Hosted Linux arm64
uses: iory/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Check Python Version
run: python --version
- name: Install Pytest
run: |
python -m pip install --upgrade pip setuptools wheel
pip install pytest hacking pytest-cov
- name: Install python package
run: pip install .
- name: Run Pytest
run: |
set -o pipefail
coverage erase
coverage run -m pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered
coverage xml
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./coverage.xml
junitxml-path: ./pytest.xml