1
- name : macOS x86_64
1
+ name : macOS ARM64
2
2
3
3
on :
4
4
pull_request :
10
10
paths-ignore :
11
11
- ' .github/workflows/build_wheels_linux*'
12
12
- ' .github/workflows/build_wheels_windows*'
13
- - ' .github/workflows/build_wheels_macos_m1 .yml'
13
+ - ' .github/workflows/build_wheels_macos .yml'
14
14
release :
15
15
types : [published, edited]
16
16
schedule :
20
20
21
21
jobs :
22
22
Build :
23
- runs-on : macos-13
24
- defaults :
25
- run :
26
- shell : bash
23
+ runs-on : python-macos12-m1
27
24
strategy :
28
25
fail-fast : false
29
26
matrix :
@@ -33,21 +30,11 @@ jobs:
33
30
without_gui : [0, 1]
34
31
build_sdist : [0]
35
32
env :
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 : x86_64
33
+ CI_BUILD : 1
48
34
SDIST : ${{ matrix.build_sdist || 0 }}
49
35
ENABLE_HEADLESS : ${{ matrix.without_gui }}
50
36
ENABLE_CONTRIB : ${{ matrix.with_contrib }}
37
+ PIP_INDEX_URL : https://pypi.tuna.tsinghua.edu.cn/simple
51
38
steps :
52
39
- name : Cleanup
53
40
run : find . -mindepth 1 -delete
@@ -57,34 +44,20 @@ jobs:
57
44
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
58
45
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
59
46
fi
60
- # hack for image issue on mac: https://github.com/actions/runner-images/issues/6817
61
- rm /usr/local/bin/2to3*
62
- rm /usr/local/bin/idle3*
63
- rm /usr/local/bin/pydoc3*
64
- rm /usr/local/bin/python3*
65
- # end hack
66
47
- name : Checkout
67
48
uses : actions/checkout@v3
68
49
with :
69
50
submodules : false
70
51
fetch-depth : 0
71
52
- name : Build a package
72
53
run : |
73
- set -e
74
- # Check out and prepare the source
75
- # Multibuild doesn't have releases, so --depth would break eventually (see
76
- # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
77
54
git submodule update --init multibuild
78
- source multibuild/common_utils.sh
79
- # https://github.com/matthew-brett/multibuild/issues/116
80
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
81
- source multibuild/travis_steps.sh
82
- # This sets -x
83
- # source travis_multibuild_customize.sh
84
55
echo $ENABLE_CONTRIB > contrib.enabled
85
56
echo $ENABLE_HEADLESS > headless.enabled
86
- set -x
87
- build_wheel $REPO_DIR $PLAT
57
+ export MACOSX_DEPLOYMENT_TARGET=13.0
58
+ 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
+ python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v
60
+ delocate-wheel ${{ github.workspace }}/wheelhouse/opencv*
88
61
- name : Saving a wheel accordingly to matrix
89
62
uses : actions/upload-artifact@v4
90
63
with :
93
66
94
67
Test :
95
68
needs : [Build]
96
- runs-on : macos-13
97
- defaults :
98
- run :
99
- shell : bash
69
+ runs-on : python-macos12-m1
100
70
strategy :
101
71
fail-fast : false
102
72
matrix :
@@ -106,14 +76,9 @@ jobs:
106
76
without_gui : [0, 1]
107
77
build_sdist : [0]
108
78
env :
109
- ACTIONS_ALLOW_UNSECURE_COMMANDS : true
110
- MB_PYTHON_VERSION : ${{ matrix.python-version }}
111
- NP_TEST_DEP : numpy==1.19.4
112
- NP_TEST_DEP_LATEST : numpy==2.2.1
113
- CONFIG_PATH : travis_config.sh
114
- PLAT : x86_64
115
79
OPENCV_TEST_DATA_PATH : ${{ github.workspace }}/opencv_extra/testdata
116
80
PYLINT_TEST_FILE : ${{ github.workspace }}/opencv/samples/python/squares.py
81
+ PIP_INDEX_URL : https://pypi.tuna.tsinghua.edu.cn/simple
117
82
steps :
118
83
- name : Cleanup
119
84
run : find . -mindepth 1 -delete
@@ -123,32 +88,33 @@ jobs:
123
88
with :
124
89
submodules : true
125
90
fetch-depth : 0
126
- - name : Set up Python ${{ matrix.python-version }}
127
- uses : actions/setup-python@v4
128
- with :
129
- python-version : ${{ matrix.python-version }}
130
- architecture : ${{ matrix.platform }}
131
- - name : Setup Environment variables
132
- run : if ["3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ 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
133
91
- name : Download a wheel accordingly to matrix
134
92
uses : actions/download-artifact@v4
135
93
with :
136
94
name : wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
137
95
path : wheelhouse/
96
+ - name : Create Venv for test
97
+ run : |
98
+ test -d "${{ github.workspace }}/opencv_test" && rm -rf "${{ github.workspace }}/opencv_test"
99
+ python${{ matrix.python-version }} -m venv ${{ github.workspace }}/opencv_test
138
100
- name : Package installation
139
101
run : |
140
- python -m pip install wheelhouse/opencv*.whl
102
+ source ${{ github.workspace }}/opencv_test/bin/activate
103
+ python${{ matrix.python-version }} -m pip install --upgrade pip
104
+ python${{ matrix.python-version }} -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl
141
105
cd ${{ github.workspace }}/tests
142
- python get_build_info.py
106
+ python${{ matrix.python-version }} get_build_info.py
143
107
- name : Run tests
144
108
run : |
109
+ source ${{ github.workspace }}/opencv_test/bin/activate
145
110
cd ${{ github.workspace }}/opencv
146
- python modules/python/test/test.py -v --repo .
111
+ python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
147
112
- name : Pylint test
148
113
run : |
149
- python -m pip install pylint==2.15.9
114
+ source ${{ github.workspace }}/opencv_test/bin/activate
115
+ python${{ matrix.python-version }} -m pip install pylint==2.15.9
150
116
cd ${{ github.workspace }}/tests
151
- python -m pylint $PYLINT_TEST_FILE
117
+ python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE
152
118
153
119
Release_rolling :
154
120
if : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
0 commit comments