Skip to content

[wip]python 3.10 [skip appveyor][skip azurepipelines] #29

[wip]python 3.10 [skip appveyor][skip azurepipelines]

[wip]python 3.10 [skip appveyor][skip azurepipelines] #29

name : Build Windows Conda Installer
on:
pull_request:
workflow_dispatch:
push:
branches:
- 'master'
- 'releases/**'
- 'testing/**'
jobs:
build:
runs-on: windows-2019
timeout-minutes: 60
env:
REPO: https://github.com/biolab/orange3.git
BUILD_BRANCH: master
BUILD_COMMIT: "3.36.1"
BUILD_LOCAL: ""
PYTHONFAULTHANDLER: 1
PIP_NO_PIP_VERSION_CHECK: 1
PIP_CACHE_DIR: .pip-cache
PIP_PREFER_BINARY: 1
CONDA_BUILD_VERSION: "3.26.*"
# CONDA_SPEC_FILE: ..\specs\win\conda-spec.txt
strategy:
fail-fast: False
matrix:
include:
- python-version: "3.10.11"
miniconda-version: "py310_22.11.1-1"
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: mamba-org/setup-micromamba@v1
with:
condarc: >-
channels:
- conda-forge
- defaults
environment-name: build
create-args: conda conda-build boa python=3.11
init-shell: bash cmd.exe
generate-run-shell: true
- name: Checkout orange3
shell: bash
run: |
set -e
git clone -q $REPO
cd orange3
git fetch origin $BUILD_BRANCH
git checkout $BUILD_COMMIT
- name: Prepare conda packages
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
if [[ $BUILD_LOCAL ]]; then
conda mambabuild --no-test --python $PYTHON_VERSION ./orange3/conda-recipe
VERSION=$(cd orange3; python setup.py --version)
EXTRA_ARGS=(-c file:///C:/users/runneradmin/micromamba/envs/build/conda-bld)
else
VERSION=$BUILD_COMMIT
EXTRA_ARGS=()
fi
if [[ ! $CONDA_SPEC_FILE ]]; then
micromamba create -p ./env --yes \
${EXTRA_ARGS[*]} \
python=$PYTHON_VERSION \
numpy=1.24.* \
scipy=1.10.* \
scikit-learn=1.1.* \
pandas=1.5.* \
pyqtgraph=0.13.* \
bottleneck=1.3.* \
pyqt=5.15.* \
pyqtwebengine=5.15.* \
Orange3=$VERSION \
blas=*=openblas
conda list -p ./env --export --explicit --md5 > env-spec.txt
echo "CONDA_SPEC_FILE=env-spec.txt" >> $GITHUB_ENV
fi
- name: Build installer
env:
PLATTAG: win_amd64
MINICONDA_VERSION: ${{ matrix.miniconda-version }}
run: |
mkdir dist
export PATH="$(cygpath -u 'C:\Program Files (x86)\NSIS'):$PATH"
echo PATH=$PATH
bash -e ./scripts/windows/build-conda-installer.sh \
--platform $PLATTAG \
--cache-dir .cache \
--dist-dir dist \
--miniconda-version "$MINICONDA_VERSION" \
--env-spec "$CONDA_SPEC_FILE" \
--online no
INSTALLER=( dist/Orange3*.exe )
SHA256=$( sha256sum -b $INSTALLER )
echo INSTALLER = $INSTALLER
echo SHA256 = $( sha256sum -b $INSTALLER )
- name: Upload installer
uses: actions/upload-artifact@v3
with:
name: orange-win-conda-installer
path: dist/Orange3-*.exe
if-no-files-found: error
test:
name: Test
needs: build
runs-on: windows-2019
steps:
- name: Download installer
uses: actions/download-artifact@v3
with:
name: orange-win-conda-installer
- name: Install
shell: cmd
run: |
rem # Install in silent mode. Output has to be piped somewhere so the installer
rem # runs 'attached' to the console.
for %%s in ( Orange3*.exe ) do ( set "INSTALLER=%%s" )
echo INSTALLER = %INSTALLER%
%INSTALLER% /S /D=C:\test-install > nul
- name: Run tests
shell: bash
run: |
PYTHON=$(cygpath -u 'C:\test-install\python')
$PYTHON --version
$PYTHON -m pip --version
$PYTHON -m pip list --format=freeze
# Test that orange and all dependencies are installed in a
# consistent state
$PYTHON -m pip install --no-index --no-cache-dir orange3
# Run test suite in the installed environment.
export ORANGE_DEPRECATIONS_ERROR=1
export PYTHONWARNINGS=module
$PYTHON -m unittest -v Orange.tests Orange.widgets.tests
package_portable:
name: Package a portable install
needs: [build, test]
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Download installer
uses: actions/download-artifact@v3
with:
name: orange-win-conda-installer
- name: Extract installer contents
shell: cmd
run: |
rem # Install in silent mode. Output has to be piped somewhere so the installer
rem # runs 'attached' to the console.
for %%s in ( Orange3*.exe ) do ( set "INSTALLER=%%s" )
echo INSTALLER = %INSTALLER%
%INSTALLER% /S /D=C:\test-install > nul
- name: Package portable installer
shell: cmd
run: |
mkdir dist
ci\appveyor-make-portable.bat C:\test-install %CD%\dist\Orange.zip
- name: Upload portable installer
uses: actions/upload-artifact@v3
with:
name: orange-win-portable-installer
path: dist/Orange*.zip
if-no-files-found: error