@@ -22,35 +22,20 @@ jobs:
22
22
strategy :
23
23
fail-fast : false
24
24
matrix :
25
- os : [macos -latest] # ubuntu-latest,
26
- python-version : [3.8] # [3. 6, 3.7, 3.8, 3.9]
27
- platform : [x64]
25
+ os : [windows -latest, ubuntu-latest, macos-latest]
26
+ python-version : [3.6, 3.7, 3.8, 3.9]
27
+ platform : [x32, x64]
28
28
with_contrib : [0, 1]
29
29
without_gui : [0, 1]
30
30
build_sdist : [0]
31
- # include:
32
- # - os: ubuntu-latest
33
- # python-version: 3.8
34
- # build_sdist: 1
35
- # with_contrib: 0
36
- # without_gui: 0
37
- # - os: ubuntu-latest
38
- # python-version: 3.8
39
- # build_sdist: 1
40
- # with_contrib: 0
41
- # without_gui: 1
42
- # - os: ubuntu-latest
43
- # python-version: 3.8
44
- # build_sdist: 1
45
- # with_contrib: 1
46
- # without_gui: 0
47
- # - os: ubuntu-latest
48
- # python-version: 3.8
49
- # build_sdist: 1
50
- # with_contrib: 1
51
- # without_gui: 1
31
+ exclude :
32
+ - os : macos-latest
33
+ platform : x32
34
+ - os : ubuntu-latest
35
+ platform : x32
52
36
53
37
env :
38
+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
54
39
REPO_DIR : .
55
40
BUILD_COMMIT : master
56
41
PROJECT_SPEC : opencv-python
@@ -78,51 +63,44 @@ jobs:
78
63
- name : Update submodules
79
64
run : |
80
65
git submodule update --remote
81
-
66
+
82
67
- name : Set up Python ${{ matrix.python-version }}
83
68
uses : actions/setup-python@v2
84
69
with :
85
70
python-version : ${{ matrix.python-version }}
86
71
87
72
- name : Setup Environment variables
73
+ if : ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
88
74
run : |
89
75
if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi
90
76
if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi
91
77
if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
92
78
echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV;
93
79
echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV;
94
-
80
+
95
81
- name : before install
82
+ if : ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
96
83
run : |
97
84
set -e
98
-
99
85
if [[ $SDIST == 0 ]]; then
100
86
# Check out and prepare the source
101
87
# Multibuild doesn't have releases, so --depth would break eventually (see
102
88
# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
103
89
git submodule update --init multibuild
104
-
105
90
source multibuild/common_utils.sh
106
-
107
91
# https://github.com/matthew-brett/multibuild/issues/116
108
92
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
109
-
110
93
source multibuild/travis_steps.sh
111
94
# This sets -x
112
-
113
95
# source travis_multibuild_customize.sh
114
96
echo $ENABLE_CONTRIB > contrib.enabled
115
97
echo $ENABLE_HEADLESS > headless.enabled
116
-
117
98
echo "end"
118
99
# Not interested in travis internal scripts' output
119
100
fi
120
-
121
101
set +x
122
-
123
102
# Build and package
124
103
set -x
125
-
126
104
ls
127
105
if [[ $SDIST == 1 ]]; then
128
106
python -m pip install --upgrade pip
@@ -131,9 +109,7 @@ jobs:
131
109
else
132
110
build_wheel $REPO_DIR $PLAT
133
111
fi
134
-
135
112
set +x
136
-
137
113
# Install and run tests
138
114
set -x
139
115
if [[ $SDIST == 1 ]]; then
@@ -142,15 +118,58 @@ jobs:
142
118
else
143
119
install_run $PLAT && rc=$? || rc=$?
144
120
fi
145
-
146
121
set +x
147
-
148
122
#otherwise, Travis logic terminates prematurely
149
123
#https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817
150
124
trap ERR
151
125
test "$rc" -eq 0
126
+
127
+ - name : Setup MSBuild.exe
128
+ if : ${{ matrix.os == 'windows-latest' }}
129
+ uses : warrenbuckley/Setup-MSBuild@v1
130
+
131
+ - name : build script
132
+ if : ${{ matrix.os == 'windows-latest' }}
133
+ run : |
134
+ python --version
135
+ python -m pip install --upgrade pip
136
+ python -m pip install --upgrade setuptools
137
+ set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\dist . --verbose
138
+ shell : cmd
139
+
140
+ - name : before test
141
+ if : ${{ matrix.os == 'windows-latest' }}
142
+ run : |
143
+ cd ${{ github.workspace }}/tests
144
+ $env:PYTHONWARNINGS = "ignore:::pip._internal.cli.base_command"
145
+ &python -m pip install --user --no-warn-script-location (ls "../dist/opencv_*.whl")
146
+ if ($LastExitCode -ne 0) {throw $LastExitCode}
147
+ shell : powershell
148
+
149
+ - name : run test
150
+ if : ${{ matrix.os == 'windows-latest' }}
151
+ run : |
152
+ cd ${{ github.workspace }}/tests
153
+ python -m unittest test
154
+ shell : cmd
155
+
156
+ - name : saving artifacts
157
+ if : ${{ matrix.os == 'windows-latest' }}
158
+ uses : actions/upload-artifact@v2
159
+ with :
160
+ name : ${{ matrix.os }}-wheels-${{ matrix.python-version }}-${{ matrix.platform }}-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
161
+ path : dist\opencv*.whl
152
162
153
- # - name: Upload wheels
163
+ - name : saving artifacts
164
+ if : ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
165
+ uses : actions/upload-artifact@v2
166
+ with :
167
+ name : ${{ matrix.os }}-wheels-${{ matrix.python-version }}-${{ matrix.platform }}-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
168
+ path : ./wheelhouse/opencv*.whl
169
+
170
+
171
+ # - name: Upload wheels ${{ matrix.os }}
172
+ # if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
154
173
# env:
155
174
# # PYPI repository
156
175
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
@@ -163,3 +182,30 @@ jobs:
163
182
# twine upload --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/*
164
183
# # Upload wheels to PYPITEST
165
184
# #twine upload --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/*
185
+
186
+ # - name: Upload wheels ${{ matrix.os }}
187
+ # if: ${{ matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/')}}
188
+ # env:
189
+ # USER: fXgF9uyy6sT0JoVOR7BoqA==
190
+ # PASS: 0bXSOVjf9x8L7nErTivu92TF1FwNosTjFJQPmxp8Dys=
191
+ # run: |
192
+ # cd ${{ github.workspace }}
193
+ # if (${Env:ENABLE_CONTRIB} -eq 0) {
194
+ # if (${Env:ENABLE_HEADLESS} -eq 0) {
195
+ # echo "This is a default build. Deployment will be done to PyPI entry opencv-python."
196
+ # }
197
+ # else {
198
+ # echo "This is a headless build. Deployment will be done to PyPI entry opencv-python-headless."
199
+ # }
200
+ # }
201
+ # else {
202
+ # if (${Env:ENABLE_HEADLESS} -eq 0) {
203
+ # echo "This is a contrib build. Deployment will be done to PyPI entry opencv-contrib-python."
204
+ # }
205
+ # else {
206
+ # echo "This is a headless contrib build. Deployment will be done to PyPI entry opencv-contrib-python-headless."
207
+ # }
208
+ # }
209
+ # &python -m pip install twine
210
+ # &python -m twine upload -u ${Env:USER} -p ${Env:PASS} --skip-existing dist/opencv*
211
+ # shell: powershell
0 commit comments