Skip to content

Commit 6fe52b3

Browse files
Run Python tests in GitHub actions
1 parent c62e182 commit 6fe52b3

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
push:
9+
branches-ignore:
10+
- 'master'
11+
12+
jobs:
13+
build-and-test:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
python-version: [3.7, 3.8, 3.9, 3.10.11, 3.11]
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install pipenv
26+
run: |
27+
pip3 install pipenv
28+
pip3 install --upgrade pip
29+
- name: Install dependencies
30+
run: |
31+
pipenv install --dev
32+
- name: Run code formatter
33+
run: pipenv run black src/
34+
- name: Run static analysis
35+
run: |
36+
pipenv run mypy --install-types --non-interactive src/
37+
pipenv run mypy -p src
38+
- name: Run unit tests
39+
run: pipenv run pytest -vv -s -m unit
40+

0 commit comments

Comments
 (0)