Skip to content

Commit 2ad1020

Browse files
committed
fix: github ci
1 parent 2b0a5a0 commit 2ad1020

File tree

1 file changed

+37
-21
lines changed

1 file changed

+37
-21
lines changed

.github/workflows/ci.yml

+37-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,40 @@
1-
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
4-
hooks:
5-
- id: trailing-whitespace
6-
- id: end-of-file-fixer
7-
- id: check-yaml
8-
- id: check-added-large-files
1+
name: CI
92

10-
- repo: https://github.com/psf/black
11-
rev: 23.3.0
12-
hooks:
13-
- id: black
3+
on:
4+
push:
5+
branches: [ "main", "master" ]
6+
pull_request:
7+
branches: [ "main", "master" ]
8+
# Allow manual trigger from GitHub UI
9+
workflow_dispatch:
1410

15-
- repo: https://github.com/pycqa/isort
16-
rev: 5.12.0
17-
hooks:
18-
- id: isort
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ["3.8", "3.9", "3.10", "3.11"]
1917

20-
- repo: https://github.com/pre-commit/mirrors-mypy
21-
rev: v1.3.0
22-
hooks:
23-
- id: mypy
24-
additional_dependencies: [types-all]
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
pip install pytest pytest-cov black isort mypy
29+
- name: Run linters
30+
run: |
31+
black . --check
32+
isort . --check
33+
mypy src tests
34+
- name: Run tests
35+
run: |
36+
pytest tests/ --cov=src --cov-report=xml
37+
- name: Upload coverage
38+
uses: codecov/codecov-action@v3
39+
with:
40+
file: ./coverage.xml

0 commit comments

Comments
 (0)