Skip to content

Commit 2d66253

Browse files
committed
Adapted ci pipeline, removed scripts/ folder, and moved integration test to tests/ folder
1 parent d99fa68 commit 2d66253

File tree

7 files changed

+313
-942
lines changed

7 files changed

+313
-942
lines changed

.github/workflows/ci.yml

Lines changed: 81 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
name: Installing and Testing
2-
on: [push]
1+
name: CI Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
310

4-
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
5-
# `contents` is for permission to the contents of the repository.
6-
# `pull-requests` is for permission to pull request
711
permissions:
812
contents: write
913
checks: write
@@ -13,32 +17,84 @@ env:
1317
UV_SYSTEM_PYTHON: true
1418

1519
jobs:
16-
install-and-test:
20+
linting-and-formatting:
21+
name: Ruff Lint & Format
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Ruff Check
26+
uses: chartboost/ruff-action@v1
27+
with:
28+
args: "check ."
29+
- name: Ruff Format Check
30+
uses: chartboost/ruff-action@v1
31+
with:
32+
args: "format . --check"
33+
34+
unit-tests-and-coverage:
35+
name: Unit Tests, Mypy & Coverage (Python ${{ matrix.python_version }})
1736
runs-on: ubuntu-latest
1837
strategy:
1938
fail-fast: false
2039
matrix:
2140
python_version: ["3.10", "3.11", "3.12"]
2241
steps:
23-
- uses: actions/checkout@v4
24-
- name: Set up Python ${{matrix.python_version}}
25-
uses: actions/setup-python@v5
26-
with:
27-
python-version: ${{matrix.python_version}}
28-
- name: Install uv
29-
run: |
30-
curl -LsSf https://astral.sh/uv/install.sh | sh
31-
- name: Install dependencies
32-
run: |
33-
pip install --upgrade pip
34-
uv pip install -e '.[dev]'
35-
# - name: mypy
36-
# run: |
37-
# python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional bam_masterdata tests
38-
- name: Test with pytest
39-
run: |
40-
python -m pytest -sv --ignore=tests/cli --ignore=tests/metadata/test_entities_dict.py tests
42+
- uses: actions/checkout@v4
43+
- name: Set up Python ${{matrix.python_version}}
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: ${{matrix.python_version}}
47+
- name: Install uv
48+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
49+
- name: Install dependencies
50+
run: |
51+
uv pip install -e '.[dev]'
52+
uv pip install coveralls
53+
54+
- name: Mypy Type Checking
55+
run: |
56+
python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional src/desi tests
57+
58+
- name: Run Unit Tests & Build coverage file
59+
run: |
60+
pytest --cov-config=.coveragerc --junitxml=pytest.xml --cov=src/desi -m "not integration" --ignore=tests/cli --ignore=tests/metadata/test_entities_dict.py tests | tee pytest-coverage.txt
61+
62+
- name: Pytest coverage comment
63+
if: matrix.python_version == '3.12'
64+
uses: MishaKav/pytest-coverage-comment@main
65+
with:
66+
pytest-coverage-path: pytest-coverage.txt
67+
junitxml-path: pytest.xml
68+
- name: Submit to coveralls
69+
if: matrix.python_version == '3.12'
70+
continue-on-error: true
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
coveralls --service=github
75+
76+
integration-tests:
77+
name: Integration Tests
78+
runs-on: ubuntu-latest
79+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
80+
needs: [linting-and-formatting, unit-tests-and-coverage]
81+
steps:
82+
- uses: actions/checkout@v4
83+
- name: Set up Python 3.12
84+
uses: actions/setup-python@v5
85+
with:
86+
python-version: 3.12
87+
- name: Install uv
88+
run: |
89+
curl -LsSf https://astral.sh/uv/install.sh | sh
90+
- name: Install dependencies
91+
run: uv pip install -e '.[dev]'
92+
- name: Run Integration Tests
93+
run: |
94+
python -m pytest -sv -m "integration" tests/
95+
4196
build-and-install:
97+
name: Build and Install
4298
runs-on: ubuntu-latest
4399
steps:
44100
- uses: actions/checkout@v4
@@ -55,18 +111,4 @@ jobs:
55111
python -m build --sdist
56112
- name: Install the package
57113
run: |
58-
uv pip install dist/*.tar.gz
59-
ruff-linting:
60-
runs-on: ubuntu-latest
61-
steps:
62-
- uses: actions/checkout@v4
63-
- uses: chartboost/ruff-action@v1
64-
with:
65-
args: "check ."
66-
ruff-formatting:
67-
runs-on: ubuntu-latest
68-
steps:
69-
- uses: actions/checkout@v4
70-
- uses: chartboost/ruff-action@v1
71-
with:
72-
args: "format . --check --verbose"
114+
uv pip install dist/*.tar.gz

scripts/ingest_to_vectordb.py

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)