Skip to content

Commit

Permalink
Merge pull request #153 from biolab/reusable-workflows
Browse files Browse the repository at this point in the history
CI - Use reusable workflows
  • Loading branch information
PrimozGodec committed Nov 29, 2022
2 parents 1e9f372 + 22864cc commit a6cdd84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 97 deletions.
90 changes: 2 additions & 88 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,91 +9,5 @@ on:
- master

jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 15
name: ${{ matrix.name }} (${{ matrix.os }}, ${{ matrix.python-version }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8]
tox_env: [py-orange-released]
experimental: [false]
name: [Released]
include:
- os: windows-latest
python-version: 3.8
tox_env: py-orange-released
experimental: true
name: Windows10
- os: macos-latest
python-version: 3.8
tox_env: py-orange-released
experimental: true
name: Big Sur

- os: windows-2019
python-version: 3.7
tox_env: py-orange-oldest
experimental: false
name: Oldest
- os: macos-10.15
python-version: 3.7
tox_env: py-orange-oldest
name: Oldest
experimental: false
- os: ubuntu-18.04
python-version: 3.7
tox_env: py-orange-oldest
name: Oldest
experimental: false

- os: windows-latest
python-version: 3.8
tox_env: py-orange-latest
experimental: false
name: Latest
- os: macos-latest
python-version: 3.8
tox_env: py-orange-latest
experimental: false
name: Latest
- os: ubuntu-latest
python-version: 3.8
tox_env: py-orange-latest
experimental: false
name: Latest

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-pip-version
- name: Set environment variable
# this step sets QT_QPA_PLATFORM env which is mandatory on Linux and
# it is skipped on Windows since it produces SEGFAULT when WebView used
if: runner.os != 'Windows'
run: |
echo "QT_QPA_PLATFORM=offscreen" >> $GITHUB_ENV
- name: Test with Tox
run: |
tox -e ${{ matrix.tox_env }}
- name: Upload code coverage
if: |
matrix.python-version == '3.8' &&
matrix.os == 'ubuntu-18.04' &&
matrix.tox_env == 'py-orange-released'
run: |
pip install codecov
codecov
test:
uses: biolab/orange-ci-cd/.github/workflows/test-addons.yml@master
2 changes: 1 addition & 1 deletion orangecontrib/educational/widgets/owpiecharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def update_legend(self, colors, labels):
def pie_chart(self, x, y, r, dist, colors):
start_angle = 0
dist = np.asarray(dist)
spans = dist / (float(np.sum(dist)) or 1) * 360 * 16
spans = np.round(dist / (float(np.sum(dist)) or 1) * 360 * 16).astype(int)
for span, color in zip(spans, colors):
if not span:
continue
Expand Down
11 changes: 3 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{37,38}-orange-{oldest, latest, released}
orange-{oldest, latest, released}
skip_missing_interpreters = true
isolated_build = true

Expand All @@ -15,17 +15,12 @@ passenv = *
changedir =
{envsitepackagesdir}
setenv =
# Raise deprecations as errors in our tests
ORANGE_DEPRECATIONS_ERROR=y
# Need this otherwise unittest installs a warning filter that overrides
# our desire to have OrangeDeprecationWarnings raised
PYTHONWARNINGS=module
# set coverage output and project config
COVERAGE_FILE = {toxinidir}/.coverage
COVERAGE_RCFILE = {toxinidir}/.coveragerc
deps =
pyqt5==5.12.*
pyqtwebengine==5.12.*
{env:PYQT_PYPI_NAME:PyQt5}=={env:PYQT_PYPI_VERSION:5.15.*}
{env:WEBENGINE_PYPI_NAME:PyQtWebEngine}=={env:WEBENGINE_PYPI_VERSION:5.15.*}
oldest: scikit-learn~=1.0.1
oldest: orange3==3.31.1
latest: https://github.com/biolab/orange3/archive/refs/heads/master.zip#egg=orange3
Expand Down

0 comments on commit a6cdd84

Please sign in to comment.