Merge pull request #5 from scientificcomputing/add-scale-idealized #51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build: | |
| name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache conda | |
| uses: actions/cache@v3 | |
| env: | |
| # Increase this value to reset cache if environment.yml has not changed | |
| CACHE_NUMBER: 0 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: | |
| ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-py-${{ matrix.python-version }}${{ | |
| hashFiles('environment.yml') }} | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| auto-update-conda: false | |
| channels: conda-forge | |
| activate-environment: mri2mesh | |
| environment-file: environment.yml | |
| - name: Install mri2mesh | |
| shell: bash -el {0} | |
| run: | | |
| python -m pip install -e ".[test]" | |
| - name: Test with pytest | |
| shell: bash -el {0} | |
| run: | | |
| python -m pytest --cov=mri2mesh --cov-report html --cov-report xml --cov-report term-missing -v | |
| - name: Coverage report | |
| if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' | |
| shell: bash -el {0} | |
| run: | | |
| python3 -m coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY | |
| python3 -m coverage json | |
| export TOTAL=$(python3 -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") | |
| echo "total=$TOTAL" >> $GITHUB_ENV | |
| - name: Upload HTML report. | |
| if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: html-report | |
| path: htmlcov |