Skip to content

Commit

Permalink
Fix issues with test-n-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
soininen committed Aug 25, 2023
1 parent 194780e commit 2f87eb0
Showing 1 changed file with 54 additions and 15 deletions.
69 changes: 54 additions & 15 deletions .github/workflows/test-n-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -77,27 +76,67 @@ 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 Spine-Toolbox
python -m unittest discover --verbose
cd ../spine-items
python -m unittest discover --verbose
cd ../spine-engine
python -m unittest discover --verbose
cd ../Spine-Database-API
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 Spine-Toolbox
python -m unittest discover --verbose
cd ../spine-items
python -m unittest discover --verbose
cd ../spine-engine
python -m unittest discover --verbose
cd ../Spine-Database-API
python -m unittest discover --verbose
cd ..
publish:
# isolate from test, to prevent partial uploads
needs: test
Expand All @@ -118,6 +157,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

0 comments on commit 2f87eb0

Please sign in to comment.