-
Notifications
You must be signed in to change notification settings - Fork 13
129 lines (112 loc) · 3.66 KB
/
build-win-installer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name : Build Windows Installer
on:
pull_request:
workflow_dispatch:
push:
branches:
- 'master'
- 'releases/**'
- 'testing/**'
jobs:
build:
runs-on: windows-2019
timeout-minutes: 30
env:
REPO: https://github.com/biolab/orange3.git
BUILD_BRANCH: master
BUILD_COMMIT: "3.36.2"
BUILD_LOCAL:
PYTHONFAULTHANDLER: 1
PIP_NO_PIP_VERSION_CHECK: 1
PIP_CACHE_DIR: .pip-cache
PIP_PREFER_BINARY: 1
BUILD_DEPS: "wheel~=0.37.0 pip~=22.0.3"
ENVSPEC: ./specs/win/PY38.txt
strategy:
fail-fast: False
matrix:
include:
- python-version: "3.9.12"
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Checkout orange3
shell: bash
run: |
set -e
git clone -q $REPO
cd orange3
git fetch origin $BUILD_BRANCH
git checkout $BUILD_COMMIT
- name: Setup Pip Cache
uses: actions/cache@v3
with:
path: .pip-cache
key: ${{ runner.os }}-py-${{ matrix.python-version }}-pip-${{ hashFiles('.github/workflows/build-win-installer.yml') }}
restore-keys: |
${{ runner.os }}-py-${{ matrix.python-version }}-pip
- name: Prepare wheels
shell: bash
run: |
python -m pip install $BUILD_DEPS
if [[ $BUILD_LOCAL ]]; then
PIP_ARGS=( -r $ENVSPEC ./orange3 );
else
PIP_ARGS=( -r $ENVSPEC Orange3==$BUILD_COMMIT );
fi
python -m pip wheel -w ./wheels -f ./wheels "${PIP_ARGS[@]}" orange3
ls ./wheels
- name: Build installer
shell: bash
env:
PYTHON_VERSION: ${{ matrix.python-version }}
PLATTAG: win_amd64
ENVSPEC: ./specs/win/PY38.txt
run: |
echo PATH=$PATH
mkdir dist
./scripts/windows/build-win-installer.sh --no-index --find-links=./wheels --python-version $PYTHON_VERSION --platform $PLATTAG --pip-arg=--pre --pip-arg=-r --pip-arg=$ENVSPEC --pip-arg=Orange3
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-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-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\Scripts\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