Skip to content

Windows build with GH Actions #32

Windows build with GH Actions

Windows build with GH Actions #32

name: 'Build Orange Windows installers'
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build ${{ matrix.name }}
runs-on: windows-2019
env:
# 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:
MINICONDA_PYTHON: C:\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
inst_python: C:\test-install\python
- name: PIP-based
python_version: '3.9.13'
plattag: win_amd64
inst_python: C:\test-install\Scripts\python
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: 3.35.0 #master
path: orange3
- name: Build Miniconda installer
if: matrix.name == 'Conda'
shell: cmd
run: |
cd orange3
rmdir /q /s "C:\Program Files (x86)\Windows Kits\10\include\wdf"
%GITHUB_WORKSPACE%\ci\build-miniconda-installer.bat
env:
PYTHON_VERSION: ${{ matrix.python_version }}
PLATTAG: ${{ matrix.plattag }}
- name: Build PIP-based installer
if: matrix.name == 'PIP-based'
shell: cmd
run: |
cd orange3
%GITHUB_WORKSPACE%\ci\build-win-installer.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
if "${{ matrix.name }}" == "Conda" ( ci\make-portable-installer.bat C:\test-install %GITHUB_WORKSPACE%\orange3\dist\Orange.zip )
"%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.
set ORANGE_DEPRECATIONS_ERROR=1
set PYTHONWARNINGS=module
"%PYTHON%" -m unittest -v Orange.tests Orange.widgets.tests || cd .
:: 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%
env:
PYTHON: ${{ matrix.inst_python }}
- name: Archive installer - ${{ matrix.name }}
uses: actions/upload-artifact@v3
with:
name: Installer
path: orange3/dist/${{ env.INSTALLER }}
if-no-files-found: error
- name: Archive build zip
uses: actions/upload-artifact@v3
if: matrix.name == 'Conda'
with:
name: Installer - ZIP
path: orange3/dist/Orange.zip
if-no-files-found: error