Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry #32

Merged
merged 12 commits into from
Jun 20, 2024
29 changes: 25 additions & 4 deletions .github/workflows/lint.yaml
ltorres6 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,38 @@ on:
- main

jobs:

pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9' # Specify the Python version you need

- name: Install Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: '1.8.3'

- name: Cache Poetry dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pypoetry
~/.virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-

- name: Install dependencies
run: poetry install

- name: Install pre-commit
run: pip install pre-commit
- name: Install osipi
run: |
poetry install -E docs
poetry install -E tests

- name: Run pre-commit
run: pre-commit run --all-files
run: poetry run pre-commit run --all-files
37 changes: 28 additions & 9 deletions .github/workflows/pytest-actions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# GitHub Actions Configuration for integrated testing using pytest
name: Test osipi

on: [push]
Expand All @@ -15,28 +14,48 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
architecture: x64

- name: Install Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: '1.8.3' # Specify the Poetry version you need

- name: Cache Poetry dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pypoetry
~/.virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-

- name: Update lock file
run: poetry lock --no-update

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
run: poetry install

- name: Install osipi
run: |
python -m pip install -e .[docs]
python -m pip install -e .[tests]
poetry install -E docs
poetry install -E tests

- name: Test with pytest
run: |
python -m pip install pytest pytest-cov
pytest --junitxml=junit/test-results.xml --cov=dbdicom tests/
run: poetry run pytest --junitxml=junit/test-results.xml --cov=dbdicom tests/

- name: Upload coverage to Codecov
if: runner.os == 'Windows'
uses: codecov/codecov-action@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist
pytest_cache
src/osipi/__pycache__
tests/__pycache__
.coverage
1 change: 1 addition & 0 deletions junit/test-results.xml
ltorres6 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="5" time="23.487" timestamp="2024-06-11T05:21:47.507973" hostname="LAPTOP-QIKPH67N"><testcase classname="tests.test_aif" name="test_aif_parker" time="0.002" /><testcase classname="tests.test_aif" name="test_aif_georgiou" time="0.001" /><testcase classname="tests.test_aif" name="test_aif_weinmann" time="0.001" /><testcase classname="tests.test_tissue" name="test_tissue_tofts" time="11.546" /><testcase classname="tests.test_tissue" name="test_tissue_extended_tofts" time="11.402" /></testsuite></testsuites>
Loading
Loading