-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.5 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
# Step 1: Check out the repository code
- name: Checkout Code
uses: actions/checkout@v3
# Step 2: Set up Python version
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Step 3: Install Poetry
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
# Step 4: Validate and Update Poetry Lock File (if needed)
- name: Validate Poetry Lock File
run: |
if ! poetry check; then
echo "pyproject.toml and poetry.lock are out of sync. Regenerating poetry.lock..."
poetry lock --no-update
fi
# Step 5: Install Dependencies
- name: Install Dependencies
run: poetry install
# Step 6: Run Unit Tests with Coverage
- name: Run Unit Tests with Coverage
run: |
poetry run pytest --maxfail=3 --disable-warnings --cov=core --cov=methodologies --cov-report=xml --cov-report=html sequestrae_engine/tests/
# Step 7: Upload Coverage Report as an Artifact (optional)
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/