Skip to content

Commit 3e8be6c

Browse files
GH workflow for unit tests
1 parent 1b0c70d commit 3e8be6c

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/unit-test.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Unit tests
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-20.04
11+
strategy:
12+
matrix:
13+
python-version: [3.6, 3.7, 3.8]
14+
15+
steps:
16+
- name: configure aws credentials
17+
uses: mapbox/configure-aws-credentials-internal@v5
18+
with:
19+
target-account-id: ${{ vars.AWS_ACCOUNT_ID_DEFAULT }}
20+
21+
- name: setup GH reader token
22+
uses: mapbox/setup-github-tokens@v2
23+
with:
24+
scope-type: 'reader'
25+
26+
- uses: actions/checkout@v4
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip setuptools
36+
pip install "importlib-metadata==4.8.3"
37+
pip install -r requirements.txt -e .[test]
38+
39+
- name: Show Python and pytest versions
40+
run: |
41+
python --version
42+
pytest --version
43+
44+
- name: Run pre-commit checks
45+
run: pre-commit run --all-files
46+
47+
- name: Run tests with coverage
48+
run: pytest --cov --cov-config=.coveragerc
49+
50+
- name: Upload coverage to GitHub (optional, internal)
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: coverage-report
54+
path: .coverage

0 commit comments

Comments
 (0)