Skip to content

Test wheels

Test wheels #51

Workflow file for this run

name: Test wheels
on:
push:
paths:
- '.github/workflows/test-wheels.yml'
workflow_call:
inputs:
os:
type: string
required: false
wheel_source:
type: string
required: false
workflow_dispatch:
inputs:
os:
type: string
required: false
wheel_source:
type: string
required: false
schedule:
- cron: '5 6 * * *'
jobs:
generate-matrix:
uses: ./.github/workflows/generate-matrix.yml
with:
os: ${{ inputs.os }}
test-wheels:
needs: [generate-matrix]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.generate-matrix.outputs.test_matrix) }}
runs-on: ${{ matrix.os }}
env:
WHEEL_SOURCE: ${{ inputs.wheel_source || 'https://sumo.dlr.de/daily/ciwheels' }}
steps:
- name: Cloning SUMO
# We just need the tests, so we are fine with a shallow checkout.
# This also ensures we have the same commit as with the initial checkout.
uses: actions/checkout@v6
- name: Downloading wheels artifact
uses: actions/download-artifact@v7
with:
path: python-wheels
merge-multiple: true
- name: Configuring Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}
- name: Preparing Python environment
shell: bash
run: |
python -m venv testenv --system-site-packages
source testenv/*/activate
python -m pip install --upgrade pip
python -m pip install wheel # need to do this separately because the texttest install wants it
python -m pip install texttest
- name: Installing dependencies (windows)
if: matrix.os == 'windows-latest'
# texttest has a hard time finding dependencies
run: python -m pip install -r tools/req_ci.txt -r tools/requirements.txt
- name: Installing sumo wheels (macos / windows)
if: ${{ !startsWith(matrix.os, 'ubuntu') || inputs.wheel_source != 'python-wheels' }}
shell: bash
run: |
source testenv/*/activate
python -m pip install --no-index -f $WHEEL_SOURCE eclipse_sumo
python -c "import sumo; print('SUMO_HOME=' + sumo.SUMO_HOME)" >> $GITHUB_ENV
- name: Installing sumo wheels (linux)
if: ${{ startsWith(matrix.os, 'ubuntu') && inputs.wheel_source == 'python-wheels' }}
shell: bash
run: |
ls python-wheels
WHEEL=$(ls python-wheels/eclipse_sumo*${{ matrix.manylinux }}*$(uname -m).whl)
echo wheel=$WHEEL
source testenv/*/activate
python -m pip install $WHEEL
python -c "import sumo; print('SUMO_HOME=' + sumo.SUMO_HOME)" >> $GITHUB_ENV
- name: Running tests with sumo wheel
# we do not test all applications at once to fail earlier and to have a better readable report
# also windows seems to have problems with loading many tests at once
shell: bash
run: |
source testenv/*/activate
OS=$(echo "${{ matrix.os }}" | cut -f1 -d-)
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then OS=linux; fi
if [[ "${{ matrix.os }}" == "ubuntu-24.04-arm" ]]; then OS=linux_arm; fi
export SUMO_BIN_DIR=$(python -c "import os,sys; print(os.path.dirname(sys.executable))")
TEXTTEST_CALL="tests/runTests.sh -b ci -v ci.fast -finverse $PWD/tests/filter_files/${OS}_failures.txt"
$TEXTTEST_CALL -a activitygen,duarouter,jtrrouter,marouter,od2trips,polyconvert
$TEXTTEST_CALL -a netconvert,netgen
python -m pip install -r tools/req_ci.txt -r tools/requirements.txt
$TEXTTEST_CALL -a sumo
$TEXTTEST_CALL -a complex,tools,traci
- name: Cleaning up test environment
shell: bash
run: |
rm -rf testenv
echo 'SUMO_HOME=' >> $GITHUB_ENV
- name: Preparing Python environment for libsumo
shell: bash
run: |
python -m venv libsumo_testenv --system-site-packages
source libsumo_testenv/*/activate
python -m pip install --upgrade pip
python -m pip install wheel # need to do this separately because the texttest install wants it
python -m pip install texttest
- name: Installing libsumo wheels (macos / windows)
if: ${{ !startsWith(matrix.os, 'ubuntu') || inputs.wheel_source != 'python-wheels' }}
shell: bash
run: |
if [[ "${{ matrix.os }}" != "windows-latest" ]]; then source libsumo_testenv/*/activate; fi
python -m pip install --no-index -f $WHEEL_SOURCE libsumo
- name: Installing libsumo wheels (linux)
if: ${{ startsWith(matrix.os, 'ubuntu') && inputs.wheel_source == 'python-wheels' }}
shell: bash
run: |
source libsumo_testenv/*/activate
python -m pip install --no-index -f python-wheels traci sumo-data
PYTAG="${{ matrix.python_version }}"
WHEEL=$(ls python-wheels/libsumo*cp${PYTAG/.}-cp${PYTAG/.}-*${{ matrix.manylinux }}*$(uname -m).whl)
echo wheel=$WHEEL
python -m pip install $WHEEL
- name: Running libsumo tests
shell: bash
run: |
source libsumo_testenv/*/activate
tests/runTests.sh -b ci -v ci -a complex.libsumo
- name: Compressing test results
if: failure()
shell: bash
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then choco install zip -y; fi
zip -r texttesttmp.zip ~/.texttest/tmp
- name: Uploading test results
if: failure()
uses: actions/upload-artifact@v6
with:
name: texttesttmp-${{ matrix.os }}-${{ matrix.manylinux }}-${{ matrix.python_version }}
path: texttesttmp.zip
if-no-files-found: warn