Skip to content

Windows build with GH Actions #12

Windows build with GH Actions

Windows build with GH Actions #12

name: 'Build Orange Windows installers'
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build ${{ matrix.name }}
runs-on: windows-2019
env:
# Commit ref/tag to checkout
BUILD_COMMIT: FETCH_HEAD
# Build the package locally or use the build packages from
# conda-forge / PyPI. The BUILD_COMMIT must match the package version
# to build.
# Comment/override this if building release versions.
BUILD_LOCAL: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
# build env dependencies for building orange3 wheels or any of its
# dependencies that do not have wheels available
BUILD_DEPS: wheel~=0.37.0 pip~=22.0.3
# conda build envs
CONDA: C:\Miniconda\Scripts\conda
MINICONDA_VERSION: 'py39_4.12.0'
CONDA_BUILD_VERSION: '3.22'
CONDA_USE_ONLY_TAR_BZ2: ""
CONDA_SPEC_FILE:
PYTHON: C:\Miniconda\python # todo: change name to miniconda python
# python-pip build
ENVSPEC: ../specs/win/PY38.txt
strategy:
fail-fast: False
# Note the python version here refers to the one included in the installer
# not the one used for building/packaging
matrix:
include:
- name: "Conda"
PYTHON_VERSION: '3.9.12'
PLATTAG: win_amd64
- name: "PIP-based"
PYTHON_VERSION: '3.9.13'
PLATTAG: win_amd64
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set worker Python version
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Checkout Orange
uses: actions/checkout@v3
with:
# git repo from which to pull orange3 sources
repository: biolab/orange3
# Branch/ref from which to pull
ref: master
path: orange3
- name: Build script
shell: cmd
run: |
cd orange3
set "PATH=C:\msys64\usr\bin;C:\Program Files (x86)\NSIS;%PATH%"
pacman -S --noconfirm zip unzip
if "${{ matrix.name }}" == "Conda" ( rmdir /q /s "C:\Program Files (x86)\Windows Kits\10\include\wdf" )
if "${{ matrix.name }}" == "Conda" ( CALL ..\ci\appveyor-conda-build.bat )
echo "Build PIP-Orange"
if not "${{ matrix.name }}" == "Conda" ( CALL ..\ci\appveyor-build.bat )
env:
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
PLATTAG: ${{ matrix.PLATTAG }}
- name: Find installers
shell: cmd
run: |
for %%s in ( orange3/dist/Orange3*.exe ) do (
echo "INSTALLER=%%s"
echo INSTALLER=%%s >> %GITHUB_ENV%
)
- name: Test script
shell: cmd
run: |
echo INSTALLER = %INSTALLER%
:: cleanup registry of anaconda reg keys
reg delete HKEY_LOCAL_MACHINE\Software\Python\ContinuumAnalytics /f || cd .
reg delete HKEY_CURRENT_USER\Software\Python\ContinuumAnalytics /f || cd .
dir orange3\dist
:: Install in silent mode. Output has to be piped somewhere so the installer
:: runs 'attached' to the console.
echo "Installing Orange"
orange3\dist\%INSTALLER% /S /D=C:\test-install > nul
:: The venv and conda envs create different install layouts.
# todo
if not "${{ matrix.name }}" == "Conda" ( set "PYTHON=C:\test-install\Scripts\python" )
if "${{ matrix.name }}" == "Conda" ( set "PYTHON=C:\test-install\python" )
if "${{ matrix.name }}" == "Conda" ( ci\appveyor-make-portable.bat C:\test-install %GITHUB_WORKSPACE%\orange3\dist\Orange.zip )
echo "Test pip"
"%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
echo "Run Orange tests"
:: Run test suite in the installed environment.
set ORANGE_DEPRECATIONS_ERROR=1
set PYTHONWARNINGS=module
"%PYTHON%" -m unittest -v Orange.tests Orange.widgets.tests || cd .
echo "End"
:: Log the filename and the sha checksum
for /f %%s in ( 'sha256sum -b orange3/dist/%INSTALLER%' ) do ( set "CHECKSUM=%%s" )
echo INSTALLER = %INSTALLER%
echo SHA256 = %CHECKSUM%
- name: Archive installer
uses: actions/upload-artifact@v2
with:
name: Installer
path: orange3/dist/${{ env.INSTALLER }}
- name: Archive build zip
uses: actions/upload-artifact@v2
if: ${{ matrix.name }} == 'Conda'
with:
name: Installer
path: orange3/dist/Orange.zip