From 0787673381476a4adbdd7fb162d2347c25cb07f9 Mon Sep 17 00:00:00 2001 From: Marko Toplak Date: Tue, 9 Jan 2024 11:46:37 +0100 Subject: [PATCH] Test separing workflows --- .github/workflows/single.yml | 87 +++++++++++++++++++++++++++++++ .github/workflows/test-addons.yml | 54 +++++++++++++++++++ .github/workflows/test.yml | 2 +- 3 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/single.yml create mode 100644 .github/workflows/test-addons.yml diff --git a/.github/workflows/single.yml b/.github/workflows/single.yml new file mode 100644 index 000000000..8f65278f8 --- /dev/null +++ b/.github/workflows/single.yml @@ -0,0 +1,87 @@ +name: Test single + +on: + workflow_call: + inputs: + os: + required: true + type: string + python-version: + required: true + type: string + tox-env: + required: true + type: string + pyqt: + required: true + type: string + experimental: + required: true + type: boolean + +jobs: + build: + runs-on: ${{ inputs.os }} + continue-on-error: ${{ inputs.experimental }} + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ inputs.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python-version }} + + - name: Install linux system dependencies + # PyQt6 need special system dependencies on Ubuntu + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libegl1-mesa libxcb-shape0 libxcb-cursor0 glibc-tools + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade tox + + - name: Test with Tox at Ubuntu + if: inputs.os == 'ubuntu-latest' + run: | + catchsegv xvfb-run -a -s "$XVFBARGS" tox -e ${{ inputs.tox_env }} + env: + # Set pyqt and webengine versions. + PYQT_PYPI_NAME: "${{ startsWith(inputs.pyqt, '5') && 'PyQt5' || 'PyQt6' }}" + PYQT_PYPI_VERSION: ${{ inputs.pyqt }} + WEBENGINE_PYPI_NAME: "${{ startsWith(inputs.pyqt, '5') && 'PyQtWebEngine' || 'PyQt6-WebEngine' }}" + WEBENGINE_PYPI_VERSION: ${{ inputs.pyqt }} + + # Need this otherwise unittest installs a warning filter that overrides + # our desire to have OrangeDeprecationWarnings raised + PYTHONWARNINGS: module + # for xvfb at Ubuntu + XVFBARGS: "-screen 0 1280x1024x24" + # on Ubuntu QTWEBENGINE_CHROMIUM_FLAGS needs to be set for webview to work + QTWEBENGINE_CHROMIUM_FLAGS: "--disable-gpu --no-sandbox" + + - name: Test with Tox at other systems + if: inputs.os != 'ubuntu-latest' + run: tox -e ${{ inputs.tox_env }} + env: + # Set pyqt and webengine versions. + PYQT_PYPI_NAME: "${{ startsWith(inputs.pyqt, '5') && 'PyQt5' || 'PyQt6' }}" + PYQT_PYPI_VERSION: ${{ inputs.pyqt }} + WEBENGINE_PYPI_NAME: "${{ startsWith(inputs.pyqt, '5') && 'PyQtWebEngine' || 'PyQt6-WebEngine' }}" + WEBENGINE_PYPI_VERSION: ${{ inputs.pyqt }} + + # Raise deprecations as errors in our tests only when testing orange-oldest and orange-released. + ORANGE_DEPRECATIONS_ERROR: "${{ inputs.tox_env != 'orange-latest' && '1' || '' }}" + # Need this otherwise unittest installs a warning filter that overrides + # our desire to have OrangeDeprecationWarnings raised + PYTHONWARNINGS: module + + - name: Upload code coverage + if: | + inputs.python-version == '3.10' && + inputs.os == 'ubuntu-latest' && + inputs.tox_env == 'orange-released' + run: | + pip install codecov + codecov diff --git a/.github/workflows/test-addons.yml b/.github/workflows/test-addons.yml new file mode 100644 index 000000000..ab914e932 --- /dev/null +++ b/.github/workflows/test-addons.yml @@ -0,0 +1,54 @@ +name: Test + +on: + push + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest] + python-version: ['3.10'] + tox_env: [orange-released] + pyqt: ['5.15.*', '6.6.*'] + experimental: [false] + include: + - os: windows-latest + python-version: '3.9' + tox_env: orange-oldest + pyqt: '5.15.*' + experimental: false + - os: macOS-latest + python-version: '3.9' + tox_env: orange-oldest + pyqt: '5.15.*' + experimental: false + - os: ubuntu-latest + python-version: '3.9' + tox_env: orange-oldest + pyqt: '5.15.*' + experimental: false + + - os: windows-latest + python-version: '3.11' + tox_env: orange-latest + pyqt: '5.15.*' + experimental: false + - os: macOS-latest + python-version: '3.11' + tox_env: orange-latest + pyqt: '5.15.*' + experimental: false + - os: ubuntu-latest + python-version: '3.11' + tox_env: orange-latest + pyqt: '5.15.*' + experimental: false + uses: ./github/workflows/single.yml + with: + os: ${{ matrix.os }} + python-version: ${{ matrix.python-version }} + tox-env: ${{ matrix.tox-env }} + pyqt: ${{ matrix.pyqt }} + experimental: ${{ matrix.experimental }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d83b78c15..a359987cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,4 +10,4 @@ on: jobs: test: - uses: biolab/orange-ci-cd/.github/workflows/test-addons.yml@master \ No newline at end of file + uses: ./.github/workflows/test-addons.yml