Merge pull request #50 from ales-erjavec/avoid-micorsoft-store-python #87
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_23.11.0-1" | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 | |
cat 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@v4 | |
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@v4 | |
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=D:\test-install > nul | |
- name: Run tests | |
shell: bash | |
run: | | |
PYTHON=$(cygpath -u 'D:\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 | |
- name: Test conda | |
shell: cmd | |
run: | | |
D:\test-install\Scripts\conda.bat --help | |
D:\test-install\Scripts\conda.bat info | |
D:\test-install\Scripts\activate.bat | |
echo %CONDA_PREFIX% | |
package_portable: | |
name: Package a portable install | |
needs: [build, test] | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- 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=D:\test-install > nul | |
- name: Package portable installer | |
shell: cmd | |
run: | | |
mkdir dist | |
ci\appveyor-make-portable.bat D:\test-install %CD%\dist\Orange.zip | |
- name: Upload portable installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: orange-win-portable-installer | |
path: dist/Orange*.zip | |
if-no-files-found: error |