Skip to content

Commit 619c67a

Browse files
committed
Add GitHub Actions CI workflow for automated testing and linting
1 parent 536effe commit 619c67a

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [ "master", "feature/**" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
cache: 'pip'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install .
29+
# Install dev dependencies for linting if needed
30+
# pip install .[dev]
31+
32+
- name: Run tests
33+
run: |
34+
python -m unittest discover mapper/tests
35+
36+
lint:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: "3.10"
45+
46+
- name: Install linting tools
47+
run: |
48+
python -m pip install --upgrade pip
49+
pip install ruff
50+
51+
- name: Lint with ruff
52+
run: |
53+
# stop the build if there are Python syntax errors or undefined names
54+
ruff check .

0 commit comments

Comments
 (0)