Publish workflow - fix syntax #2
Workflow file for this run
This file contains 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: unit-tests | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
test-all: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
include: | |
- os: ubuntu-latest | |
python-version: '3.10' | |
send-coverage: true | |
pytest-args: --cov=pydicom --cov-append | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
python -m pip install --upgrade pip | |
echo "::set-output name=dir::$(pip cache dir)" | |
- name: pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: py${{ matrix.python-version }}-${{ matrix.os }}-pip | |
- name: Cache pydicom test data | |
id: cache-testdata | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.HOME }}/.pydicom | |
key: pydicom-testdata | |
- name: Initial test environment setup | |
run: | | |
python -m pip install --editable . | |
python -m pip install --upgrade wheel pytest pytest-cov | |
# Core library tests | |
- name: Test core library | |
run: | | |
pytest ${{ matrix.pytest-args }} | |
- name: Test external sources using pydicom-data | |
run: | | |
python -m pip install git+https://github.com/pydicom/pydicom-data | |
pytest ${{ matrix.pytest-args}} pydicom/tests/test_data_manager.py | |
# Pixel data tests | |
- name: Install and test with numpy | |
run: | | |
python -m pip install --upgrade numpy | |
pytest ${{ matrix.pytest-args }} | |
- name: Install and test Pillow | |
run: | | |
python -m pip install --upgrade pillow | |
pytest ${{ matrix.pytest-args }} pydicom/tests/test_pillow_pixel_data.py | |
python -m pip uninstall -y pillow | |
- name: Install and test jpeg_ls | |
run: | | |
python -m pip install pyjpegls | |
pytest ${{ matrix.pytest-args }} pydicom/tests/test_jpeg_ls_pixel_data.py pydicom/tests/test_JPEG_LS_transfer_syntax.py | |
python -m pip uninstall -y pyjpegls | |
- name: Install and test GDCM | |
run: | | |
python -m pip install python-gdcm | |
python -c 'import gdcm; print(gdcm.GDCM_VERSION)' | |
pytest ${{ matrix.pytest-args }} pydicom/tests/test_gdcm_pixel_data.py | |
pytest ${{ matrix.pytest-args }} pydicom/tests/test_encoders_gdcm.py | |
python -m pip uninstall -y python-gdcm | |
- name: Install and test pylibjpeg | |
run: | | |
python -m pip install pylibjpeg | |
python -m pip uninstall -y pylibjpeg-openjpeg pylibjpeg-rle | |
pytest ${{ matrix.pytest-args }} pydicom/tests/test_pylibjpeg.py | |
python -m pip install pylibjpeg-openjpeg pylibjpeg-libjpeg pylibjpeg-rle | |
pytest ${{ matrix.pytest-args }} pydicom/tests/test_pylibjpeg.py | |
- name: Test all pixel handling | |
run: | | |
python -m pip install pillow python-gdcm pyjpegls | |
pytest ${{ matrix.pytest-args }} | |
- name: Send coverage results | |
if: ${{ success() && matrix.send-coverage }} | |
uses: codecov/codecov-action@v3 |