diff --git a/.github/workflows/test-n-publish.yml b/.github/workflows/test-n-publish.yml index b480616..be19ff7 100644 --- a/.github/workflows/test-n-publish.yml +++ b/.github/workflows/test-n-publish.yml @@ -37,11 +37,11 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.8' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install build + python -m pip install build - name: Build run: | python -m build ${{ matrix.pkg }} @@ -57,12 +57,11 @@ jobs: strategy: matrix: pkg: ['Spine-Toolbox', 'spine-items', 'spine-engine', 'Spine-Database-API'] - os: [ubuntu-latest, macos-latest, windows-latest] - + os: [ubuntu-latest, windows-latest] + fail-fast: false runs-on: ${{ matrix.os }} steps: - name: Make dist directory - # FIXME: does this work on Windows? run: mkdir -p dist - name: Download all wheels uses: actions/download-artifact@v3 @@ -77,27 +76,55 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.9' - - name: Install pytest and built wheels + python-version: '3.8' + - name: Install pytest and built wheels on *NIX + if: runner.os != 'Windows' + run: | + python -m pip install --upgrade pip + python -m pip install dist/*/*.whl + python -m pip install pytest + - name: Install pytest and built wheels on Windows + if: runner.os == 'Windows' run: | python -m pip install --upgrade pip - pip install dist/*/*.whl - pip install pytest + Get-ChildItem ./dist/*.whl -Recurse | ForEach-Object {python -m pip install $_} + python -m pip install pytest - name: Install additional packages for Linux if: runner.os == 'Linux' run: | sudo apt-get update -y sudo apt-get install -y libegl1 - - name: Remove source from checkouts - # FIXME: What is the Windows equivalent? + - name: Remove source from checkouts for *NIX + if: runner.os != 'Windows' run: | rm -rf Spine-Toolbox/spinetoolbox* spine-items/spine_items \ spine-engine/spine_engine Spine-Database-API/spinedb_api - - name: Test wheels + - name: Remove source from checkouts for Windows + if: runner.os == 'Windows' + run: | + Remove-Item Spine-Toolbox\spinetoolbox* -Recurse -Force -ErrorAction Ignore + Remove-Item spine-items\spine_items -Recurse -Force -ErrorAction Ignore + Remove-Item spine-engine\spine_engine -Recurse -Force -ErrorAction Ignore + Remove-Item Spine-Database-API\spinedb_api -Recurse -Force -ErrorAction Ignore + - name: Test wheels on *NIX + if: runner.os != 'Windows' # FIXME: how to run execution tests for Spine-Toolbox + env: + QT_QPA_PLATFORM: offscreen run: | - python -m unittest discover -s ${{ matrix.pkg }} - + # FIXME: The cd stuff below is a workaround for bug in spinetoolbox tests + cd ${{ matrix.pkg }} + python -m unittest discover --verbose + cd .. + # FIXME: Use the line below once spine-tools/Spine-Toolbox#2274 is fixed + #python -m unittest discover -s ${{ matrix.pkg }} --verbose + - name: Test wheels on Windows + if: runner.os == 'Windows' + # FIXME: how to run execution tests for Spine-Toolbox + run: | + cd ${{ matrix.pkg }} + python -m unittest discover --verbose + cd .. publish: # isolate from test, to prevent partial uploads needs: test @@ -118,6 +145,6 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: # repository-url: https://test.pypi.org/legacy/ - packages-dir: dist/${{ matrix.pkg}} + packages-dir: dist/${{ matrix.pkg }} # skip-existing: true # verify-metadata: false