20
20
21
21
jobs :
22
22
Build :
23
- runs-on : python-macos11-m1
23
+ runs-on : macos-12-large
24
+ defaults :
25
+ run :
26
+ shell : bash
24
27
strategy :
25
28
fail-fast : false
26
29
matrix :
30
33
without_gui : [0, 1]
31
34
build_sdist : [0]
32
35
env :
33
- CI_BUILD : 1
36
+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
37
+ REPO_DIR : .
38
+ PROJECT_SPEC : opencv-python
39
+ MB_PYTHON_VERSION : ${{ matrix.python-version }}
40
+ TRAVIS_PYTHON_VERSION : ${{ matrix.python-version }}
41
+ MB_ML_VER : 2014
42
+ TRAVIS_BUILD_DIR : ${{ github.workspace }}
43
+ TRAVIS_OS_NAME : osx
44
+ CONFIG_PATH : travis_config.sh
45
+ USE_CCACHE : 1
46
+ UNICODE_WIDTH : 32
47
+ PLAT : arm64
34
48
SDIST : ${{ matrix.build_sdist || 0 }}
35
49
ENABLE_HEADLESS : ${{ matrix.without_gui }}
36
50
ENABLE_CONTRIB : ${{ matrix.with_contrib }}
@@ -44,20 +58,35 @@ jobs:
44
58
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
45
59
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
46
60
fi
61
+ # hack for image issue on mac: https://github.com/actions/runner-images/issues/6817
62
+ rm /usr/local/bin/2to3*
63
+ rm /usr/local/bin/idle3*
64
+ rm /usr/local/bin/pydoc3*
65
+ rm /usr/local/bin/python3*
66
+ # end hack
47
67
- name : Checkout
48
68
uses : actions/checkout@v3
49
69
with :
50
70
submodules : false
51
71
fetch-depth : 0
52
72
- name : Build a package
53
73
run : |
74
+ set -e
75
+ # Check out and prepare the source
76
+ # Multibuild doesn't have releases, so --depth would break eventually (see
77
+ # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
54
78
git submodule update --init multibuild
79
+ source multibuild/common_utils.sh
80
+ # https://github.com/matthew-brett/multibuild/issues/116
81
+ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
82
+ source multibuild/travis_steps.sh
83
+ # This sets -x
84
+ # source travis_multibuild_customize.sh
55
85
echo $ENABLE_CONTRIB > contrib.enabled
56
86
echo $ENABLE_HEADLESS > headless.enabled
57
87
export MACOSX_DEPLOYMENT_TARGET=11.0
58
- arch -arm64 python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin
59
- arch -arm64 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v
60
- delocate-wheel ${{ github.workspace }}/wheelhouse/opencv*
88
+ set -x
89
+ build_wheel $REPO_DIR $PLAT
61
90
- name : Saving all wheels
62
91
uses : actions/upload-artifact@v3
63
92
with :
@@ -71,7 +100,10 @@ jobs:
71
100
72
101
Test :
73
102
needs : [Build]
74
- runs-on : opencv-cn-mac-arm64-tests
103
+ runs-on : macos-12-large
104
+ defaults :
105
+ run :
106
+ shell : bash
75
107
strategy :
76
108
fail-fast : false
77
109
matrix :
@@ -81,6 +113,12 @@ jobs:
81
113
without_gui : [0, 1]
82
114
build_sdist : [0]
83
115
env :
116
+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
117
+ MB_PYTHON_VERSION : ${{ matrix.python-version }}
118
+ NP_TEST_DEP : numpy==1.21.0
119
+ NP_TEST_DEP_LATEST : numpy==1.26.0
120
+ CONFIG_PATH : travis_config.sh
121
+ PLAT : arm64
84
122
OPENCV_TEST_DATA_PATH : ${{ github.workspace }}/opencv_extra/testdata
85
123
PYLINT_TEST_FILE : ${{ github.workspace }}/opencv/samples/python/squares.py
86
124
PIP_INDEX_URL : https://pypi.tuna.tsinghua.edu.cn/simple
@@ -93,25 +131,32 @@ jobs:
93
131
with :
94
132
submodules : true
95
133
fetch-depth : 0
134
+ - name : Set up Python ${{ matrix.python-version }}
135
+ uses : actions/setup-python@v4
136
+ with :
137
+ python-version : ${{ matrix.python-version }}
138
+ architecture : ${{ matrix.platform }}
139
+ - name : Setup Environment variables
140
+ run : if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
96
141
- name : Download a wheel accordingly to matrix
97
142
uses : actions/download-artifact@v3
98
143
with :
99
144
name : wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
100
145
path : wheelhouse/
101
146
- name : Package installation
102
147
run : |
103
- arch -arm64 python${{ matrix.python-version }} - m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl
148
+ python - m pip install wheelhouse/opencv*.whl
104
149
cd ${{ github.workspace }}/tests
105
- arch -arm64 python${{ matrix.python-version }} get_build_info.py
150
+ python get_build_info.py
106
151
- name : Run tests
107
152
run : |
108
153
cd ${{ github.workspace }}/opencv
109
- arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
154
+ python modules/python/test/test.py -v --repo .
110
155
- name : Pylint test
111
156
run : |
112
- arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.15.9
157
+ python -m pip install pylint==2.15.9
113
158
cd ${{ github.workspace }}/tests
114
- arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE
159
+ python -m pylint $PYLINT_TEST_FILE
115
160
116
161
Release_rolling :
117
162
if : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
0 commit comments