diff --git a/.github/workflows/macos-tests-3.10.yml b/.github/workflows/macos-tests-3.10.yml new file mode 100644 index 0000000..490f8fd --- /dev/null +++ b/.github/workflows/macos-tests-3.10.yml @@ -0,0 +1,42 @@ +name: macos python=3.10 + +# workflow dispatch has been added for testing purposes +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ["macos-13"] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Set-up miniconda for macos and ubuntu + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: 3.10 + miniconda-version: "latest" + - name: Create conda env + run: conda create -n spare python=3.10 + - name: Install pip + run: conda run -n spare conda install pip + - name: Install spare scores + run: | + pip install setuptools twine wheel + python setup.py bdist_wheel + cd dist + WHEEL_FILE=$(ls spare_scores*) + pip install "$WHEEL_FILE" + - name: Download dependencies + run: pip install setuptools && pip install . + - name: Generate Coverage Report + run: | + pip install pytest-cov + cd tests/unit && pytest --cov=../../ --cov-report=xml + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: CBICA/spare_score diff --git a/.github/workflows/macos-tests-3.11.yml b/.github/workflows/macos-tests-3.11.yml new file mode 100644 index 0000000..36f3619 --- /dev/null +++ b/.github/workflows/macos-tests-3.11.yml @@ -0,0 +1,42 @@ +name: macos python=3.11 + +# workflow dispatch has been added for testing purposes +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ["macos-13"] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Set-up miniconda for macos and ubuntu + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: 3.11 + miniconda-version: "latest" + - name: Create conda env + run: conda create -n spare python=3.11 + - name: Install pip + run: conda run -n spare conda install pip + - name: Install spare scores + run: | + pip install setuptools twine wheel + python setup.py bdist_wheel + cd dist + WHEEL_FILE=$(ls spare_scores*) + pip install "$WHEEL_FILE" + - name: Download dependencies + run: pip install setuptools && pip install . + - name: Generate Coverage Report + run: | + pip install pytest-cov + cd tests/unit && pytest --cov=../../ --cov-report=xml + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: CBICA/spare_score diff --git a/.github/workflows/macos-tests-3.8.yml b/.github/workflows/macos-tests-3.8.yml index a82fb4d..df3f903 100644 --- a/.github/workflows/macos-tests-3.8.yml +++ b/.github/workflows/macos-tests-3.8.yml @@ -1,4 +1,4 @@ -name: MacOS python=3.8 +name: macos python=3.8 # workflow dispatch has been added for testing purposes on: [push, pull_request, workflow_dispatch] diff --git a/.github/workflows/macos-tests-3.9.yml b/.github/workflows/macos-tests-3.9.yml new file mode 100644 index 0000000..9022725 --- /dev/null +++ b/.github/workflows/macos-tests-3.9.yml @@ -0,0 +1,42 @@ +name: macos python=3.9 + +# workflow dispatch has been added for testing purposes +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ["macos-13"] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.9" + - name: Set-up miniconda for macos and ubuntu + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: 3.9 + miniconda-version: "latest" + - name: Create conda env + run: conda create -n spare python=3.9 + - name: Install pip + run: conda run -n spare conda install pip + - name: Install spare scores + run: | + pip install setuptools twine wheel + python setup.py bdist_wheel + cd dist + WHEEL_FILE=$(ls spare_scores*) + pip install "$WHEEL_FILE" + - name: Download dependencies + run: pip install setuptools && pip install . + - name: Generate Coverage Report + run: | + pip install pytest-cov + cd tests/unit && pytest --cov=../../ --cov-report=xml + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: CBICA/spare_score diff --git a/.github/workflows/ubuntu-tests-3.10.yml b/.github/workflows/ubuntu-tests-3.10.yml new file mode 100644 index 0000000..46dcbeb --- /dev/null +++ b/.github/workflows/ubuntu-tests-3.10.yml @@ -0,0 +1,36 @@ +name: ubuntu python=3.10 + +# workflow dispatch has been added for testing purposes +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ["ubuntu-latest"] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Set-up miniconda for macos and ubuntu + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: 3.10 + miniconda-version: "latest" + - name: Create conda env + run: conda create -n spare python=3.10 + - name: Install pip + run: conda run -n spare conda install pip + - name: Install spare scores + run: | + pip install setuptools twine wheel + python setup.py bdist_wheel + cd dist + WHEEL_FILE=$(ls spare_scores*) + pip install "$WHEEL_FILE" + - name: Download dependencies + run: pip install setuptools && pip install . + - name: Run unit tests + run: | + cd tests/unit && python -m unittest discover -s . -p "*.py" diff --git a/.github/workflows/ubuntu-tests-3.11.yml b/.github/workflows/ubuntu-tests-3.11.yml new file mode 100644 index 0000000..f36b53b --- /dev/null +++ b/.github/workflows/ubuntu-tests-3.11.yml @@ -0,0 +1,36 @@ +name: ubuntu python=3.11 + +# workflow dispatch has been added for testing purposes +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ["ubuntu-latest"] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Set-up miniconda for macos and ubuntu + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: 3.11 + miniconda-version: "latest" + - name: Create conda env + run: conda create -n spare python=3.11 + - name: Install pip + run: conda run -n spare conda install pip + - name: Install spare scores + run: | + pip install setuptools twine wheel + python setup.py bdist_wheel + cd dist + WHEEL_FILE=$(ls spare_scores*) + pip install "$WHEEL_FILE" + - name: Download dependencies + run: pip install setuptools && pip install . + - name: Run unit tests + run: | + cd tests/unit && python -m unittest discover -s . -p "*.py" diff --git a/.github/workflows/ubuntu-tests-3.12.yml b/.github/workflows/ubuntu-tests-3.12.yml index 766b588..c6d2cb4 100644 --- a/.github/workflows/ubuntu-tests-3.12.yml +++ b/.github/workflows/ubuntu-tests-3.12.yml @@ -1,4 +1,4 @@ -name: Ubuntu python=3.12 +name: ubuntu python=3.12 # workflow dispatch has been added for testing purposes on: [push, pull_request, workflow_dispatch] diff --git a/.github/workflows/ubuntu-tersts-3.8.yml b/.github/workflows/ubuntu-tests-3.8.yml similarity index 97% rename from .github/workflows/ubuntu-tersts-3.8.yml rename to .github/workflows/ubuntu-tests-3.8.yml index 9a176d7..f4e30cd 100644 --- a/.github/workflows/ubuntu-tersts-3.8.yml +++ b/.github/workflows/ubuntu-tests-3.8.yml @@ -1,4 +1,4 @@ -name: Ubuntu python=3.8 +name: ubuntu python=3.8 # workflow dispatch has been added for testing purposes on: [push, pull_request, workflow_dispatch] diff --git a/.github/workflows/ubuntu-tests-3.9.yml b/.github/workflows/ubuntu-tests-3.9.yml new file mode 100644 index 0000000..d7fabfc --- /dev/null +++ b/.github/workflows/ubuntu-tests-3.9.yml @@ -0,0 +1,36 @@ +name: ubuntu python=3.9 + +# workflow dispatch has been added for testing purposes +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ["ubuntu-latest"] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.9" + - name: Set-up miniconda for macos and ubuntu + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: 3.9 + miniconda-version: "latest" + - name: Create conda env + run: conda create -n spare python=3.9 + - name: Install pip + run: conda run -n spare conda install pip + - name: Install spare scores + run: | + pip install setuptools twine wheel + python setup.py bdist_wheel + cd dist + WHEEL_FILE=$(ls spare_scores*) + pip install "$WHEEL_FILE" + - name: Download dependencies + run: pip install setuptools && pip install . + - name: Run unit tests + run: | + cd tests/unit && python -m unittest discover -s . -p "*.py" diff --git a/README.md b/README.md index 2cbd8fc..b1ff1e9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,14 @@ [![codecov](https://codecov.io/gh/CBICA/spare_score/graph/badge.svg?token=7yk7pkydHE)](https://codecov.io/gh/CBICA/spare_score) -![macos python=3.12 build](https://github.com/CBICA/spare_score/actions/workflows/macos_test_cases_p3-12.yml/badge.svg) -![macos python=3.8 build](https://github.com/CBICA/spare_score/actions/workflows/macos_test_cases_p3-12.yml/badge.svg) -![ubuntu python=3.12 build](https://github.com/CBICA/spare_score/actions/workflows/ubuntu_test_cases_p3-12.yml/badge.svg) -![ubuntu python=3.8 build](https://github.com/CBICA/spare_score/actions/workflows/ubuntu_test_cases_p3-8.yml/badge.svg) +![macos python=3.12](https://github.com/CBICA/spare_score/actions/workflows/macos-tests-3.12.yml/badge.svg) +![macos python=3.11](https://github.com/CBICA/spare_score/actions/workflows/macos-tests-3.11.yml/badge.svg) +![macos python=3.10](https://github.com/CBICA/spare_score/actions/workflows/macos-tests-3.10.yml/badge.svg) +![macos python=3.9](https://github.com/CBICA/spare_score/actions/workflows/macos-tests-3.9.yml/badge.svg) +![macos python=3.8](https://github.com/CBICA/spare_score/actions/workflows/macos-tests-3.8.yml/badge.svg) +![ubuntu python=3.12](https://github.com/CBICA/spare_score/actions/workflows/ubuntu-tests-3.12.yml/badge.svg) +![ubuntu python=3.11](https://github.com/CBICA/spare_score/actions/workflows/ubuntu-tests-3.11.yml/badge.svg) +![ubuntu python=3.10](https://github.com/CBICA/spare_score/actions/workflows/ubuntu-tests-3.10.yml/badge.svg) +![ubuntu python=3.9](https://github.com/CBICA/spare_score/actions/workflows/ubuntu-tests-3.9.yml/badge.svg) +![ubuntu python=3.8](https://github.com/CBICA/spare_score/actions/workflows/ubuntu-tests-3.8.yml/badge.svg) # Compute SPARE Scores for Your Case diff --git a/dev-dependencies.txt b/dev-dependencies.txt index e1752b5..33a3c16 100644 --- a/dev-dependencies.txt +++ b/dev-dependencies.txt @@ -26,6 +26,7 @@ pluggy==1.5.0 pyparsing==3.1.0 pyrsistent==0.19.3 pytest==8.2.2 +pytest-cov==5.0.0 python-dateutil==2.8.2 pytz==2023.3 PyYAML==6.0.2