Skip to content

Commit 350a938

Browse files
authored
Create ci.yml for continuous integration with gh actions
1 parent 71746ce commit 350a938

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
19+
- run: pip install ruff
20+
- run: ruff check .
21+
22+
test:
23+
runs-on: ubuntu-latest
24+
needs: lint
25+
strategy:
26+
matrix:
27+
python-version: ["3.10", "3.12"]
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
lfs: true
33+
34+
- run: git lfs pull
35+
36+
- uses: actions/setup-python@v5
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
40+
- name: Cache pip packages
41+
uses: actions/cache@v4
42+
with:
43+
path: ~/.cache/pip
44+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
45+
restore-keys: |
46+
${{ runner.os }}-pip-${{ matrix.python-version }}-
47+
48+
- name: Install package and test dependencies
49+
run: |
50+
pip install --upgrade pip
51+
pip install ".[test]" || pip install .
52+
pip install pytest
53+
54+
- name: Run integration tests
55+
run: pytest tests/ -v

0 commit comments

Comments
 (0)