Spaces:
Running
Running
OliverPerrin
commited on
Commit
·
bcfe56d
1
Parent(s):
cd20ae1
CI: Split lint and test jobs, add pip caching for faster builds
Browse files- .github/workflows/ci.yml +24 -7
.github/workflows/ci.yml
CHANGED
|
@@ -7,7 +7,7 @@ on:
|
|
| 7 |
branches: [ "main", "master" ]
|
| 8 |
|
| 9 |
jobs:
|
| 10 |
-
|
| 11 |
runs-on: ubuntu-latest
|
| 12 |
steps:
|
| 13 |
- uses: actions/checkout@v4
|
|
@@ -17,12 +17,10 @@ jobs:
|
|
| 17 |
with:
|
| 18 |
python-version: "3.10"
|
| 19 |
|
| 20 |
-
- name: Install
|
| 21 |
run: |
|
| 22 |
python -m pip install --upgrade pip
|
| 23 |
-
pip install
|
| 24 |
-
poetry config virtualenvs.create false
|
| 25 |
-
poetry install --no-interaction --no-ansi
|
| 26 |
|
| 27 |
- name: Lint with Ruff
|
| 28 |
run: |
|
|
@@ -31,8 +29,27 @@ jobs:
|
|
| 31 |
|
| 32 |
- name: Type check with Mypy
|
| 33 |
run: |
|
| 34 |
-
mypy src/
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
- name: Run tests
|
| 37 |
run: |
|
| 38 |
-
python -m pytest tests/
|
|
|
|
| 7 |
branches: [ "main", "master" ]
|
| 8 |
|
| 9 |
jobs:
|
| 10 |
+
lint:
|
| 11 |
runs-on: ubuntu-latest
|
| 12 |
steps:
|
| 13 |
- uses: actions/checkout@v4
|
|
|
|
| 17 |
with:
|
| 18 |
python-version: "3.10"
|
| 19 |
|
| 20 |
+
- name: Install linting tools
|
| 21 |
run: |
|
| 22 |
python -m pip install --upgrade pip
|
| 23 |
+
pip install ruff mypy
|
|
|
|
|
|
|
| 24 |
|
| 25 |
- name: Lint with Ruff
|
| 26 |
run: |
|
|
|
|
| 29 |
|
| 30 |
- name: Type check with Mypy
|
| 31 |
run: |
|
| 32 |
+
mypy src/ --ignore-missing-imports
|
| 33 |
|
| 34 |
+
test:
|
| 35 |
+
runs-on: ubuntu-latest
|
| 36 |
+
steps:
|
| 37 |
+
- uses: actions/checkout@v4
|
| 38 |
+
|
| 39 |
+
- name: Set up Python
|
| 40 |
+
uses: actions/setup-python@v4
|
| 41 |
+
with:
|
| 42 |
+
python-version: "3.10"
|
| 43 |
+
cache: 'pip'
|
| 44 |
+
|
| 45 |
+
- name: Install dependencies
|
| 46 |
+
run: |
|
| 47 |
+
python -m pip install --upgrade pip
|
| 48 |
+
pip install poetry
|
| 49 |
+
poetry config virtualenvs.create false
|
| 50 |
+
poetry install --no-interaction --no-ansi --without dev
|
| 51 |
+
pip install pytest pytest-cov
|
| 52 |
+
|
| 53 |
- name: Run tests
|
| 54 |
run: |
|
| 55 |
+
python -m pytest tests/ -x -q --tb=short
|