Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 7dd127a

Browse files
committed
ci: prototype running lint / unit tests / coverage as GH actions
1 parent dfb34c4 commit 7dd127a

2 files changed

Lines changed: 95 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Lint"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
run-lint:
10+
name: lint
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Setup Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: "3.10"
19+
- name: Install nox
20+
run: |
21+
python -m pip install --upgrade setuptools pip wheel
22+
python -m pip install nox
23+
- name: Run lint
24+
run: |
25+
nox -s lint
26+
- name: Run lint_setup_py
27+
run: |
28+
nox -s lint_setup_py

.github/workflows/unittest.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "Unit tests"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
run-unittests:
10+
name: unit${{ matrix.option }}-${{ matrix.python }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python:
15+
- "3.6"
16+
- "3.7"
17+
- "3.8"
18+
- "3.9"
19+
- "3.10"
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
- name: Setup Python
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python }}
27+
- name: Install nox
28+
run: |
29+
python -m pip install --upgrade setuptools pip wheel
30+
python -m pip install nox
31+
- name: Run unit tests
32+
env:
33+
COVERAGE_FILE: .coverage${{ matrix.option }}-${{matrix.python }}
34+
run: |
35+
nox -s unit${{ matrix.option }}-${{ matrix.python }}
36+
- name: Upload coverage results
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: coverage-artifacts
40+
path: .coverage${{ matrix.option }}-${{ matrix.python }}
41+
42+
report-coverage:
43+
name: cover
44+
runs-on: ubuntu-latest
45+
needs:
46+
- run-unittests
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v2
50+
- name: Setup Python
51+
uses: actions/setup-python@v2
52+
with:
53+
python-version: "3.10"
54+
- name: Install coverage
55+
run: |
56+
python -m pip install --upgrade setuptools pip wheel
57+
python -m pip install coverage
58+
- name: Download coverage results
59+
uses: actions/download-artifact@v2
60+
with:
61+
name: coverage-artifacts
62+
path: .coverage-results/
63+
- name: Report coverage results
64+
run: |
65+
coverage combine .coverage-results/.coverage*
66+
coverage report --show-missing --fail-under=100
67+

0 commit comments

Comments
 (0)