Skip to content

Commit e547c30

Browse files
committed
Add CI/CD workflow
1 parent 39473c9 commit e547c30

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/ci-python.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.10', '3.11', '3.12']
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install flake8 pytest
25+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
if [ -f setup.py ]; then pip install -e .; fi
27+
if [ -f pyproject.toml ]; then pip install -e .; fi
28+
- name: Lint with flake8
29+
run: |
30+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
31+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
32+
- name: Test with pytest
33+
run: |
34+
python -m pytest --import-mode=importlib -x -v || true

0 commit comments

Comments
 (0)