22
22
strategy :
23
23
fail-fast : false
24
24
matrix :
25
- os : [macos -latest] # ubuntu-latest,
25
+ os : [windows -latest] # ubuntu-latest,
26
26
python-version : [3.8] # [3.6, 3.7, 3.8, 3.9]
27
27
platform : [x64]
28
28
with_contrib : [0, 1]
50
50
# with_contrib: 1
51
51
# without_gui: 1
52
52
53
- env :
54
- REPO_DIR : .
55
- BUILD_COMMIT : master
56
- PROJECT_SPEC : opencv-python
57
- PLAT : x86_64
58
- MB_PYTHON_VERSION : ${{ matrix.python-version }}
59
- TRAVIS_PYTHON_VERSION : ${{ matrix.python-version }}
60
- MB_ML_VER : 2014
61
- NP_TEST_DEP : numpy
62
- TRAVIS_BUILD_DIR : ${{ github.workspace }}
63
- CONFIG_PATH : travis_config.sh
64
- DOCKER_IMAGE : quay.io/skvark/manylinux2014_${PLAT}
65
- USE_CCACHE : 1
66
- UNICODE_WIDTH : 32
67
- SDIST : ${{ matrix.build_sdist || 0}}
68
- ENABLE_HEADLESS : ${{ matrix.without_gui }}
69
- ENABLE_CONTRIB : ${{ matrix.with_contrib }}
70
-
71
53
steps :
72
54
- name : Checkout
73
55
uses : actions/checkout@v2
@@ -80,86 +62,35 @@ jobs:
80
62
git submodule update --remote
81
63
82
64
- name : Set up Python ${{ matrix.python-version }}
83
- uses : actions/setup-python@v2
84
- with :
85
- python-version : ${{ matrix.python-version }}
86
-
87
- - name : Setup Environment variables
88
65
run : |
89
- if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi
90
- 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
- if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
92
- echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV;
93
- echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV;
94
-
95
- - name : before install
66
+ if [[ ! $env:PYTHON ]] {
67
+ curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/devel/install_python.ps1
68
+ .\install_python.ps1
69
+ }
70
+ if [[ ! $env:PYTHON ]]; then echo "No PYTHON"; fi
71
+ set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
72
+ python --version
73
+
74
+ - name : build script
96
75
run : |
97
- set -e
98
-
99
- if [[ $SDIST == 0 ]]; then
100
- # Check out and prepare the source
101
- # Multibuild doesn't have releases, so --depth would break eventually (see
102
- # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
103
- git submodule update --init multibuild
104
-
105
- source multibuild/common_utils.sh
106
-
107
- # https://github.com/matthew-brett/multibuild/issues/116
108
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
109
-
110
- source multibuild/travis_steps.sh
111
- # This sets -x
112
-
113
- # source travis_multibuild_customize.sh
114
- echo $ENABLE_CONTRIB > contrib.enabled
115
- echo $ENABLE_HEADLESS > headless.enabled
76
+ "%PYTHON%\\python.exe" -m pip install --upgrade pip
77
+ "%PYTHON%\\python.exe" -m pip install --upgrade setuptools
78
+ set "CI_BUILD=1" && "%PYTHON%\\python.exe" -m pip wheel --wheel-dir=%cd%\dist . --verbose
116
79
117
- echo "end"
118
- # Not interested in travis internal scripts' output
119
- fi
120
-
121
- set +x
122
-
123
- # Build and package
124
- set -x
125
-
126
- ls
127
- if [[ $SDIST == 1 ]]; then
128
- python -m pip install --upgrade pip
129
- python -m pip install scikit-build
130
- python setup.py sdist
131
- else
132
- build_wheel $REPO_DIR $PLAT
133
- fi
134
-
135
- set +x
136
-
137
- # Install and run tests
138
- set -x
139
- if [[ $SDIST == 1 ]]; then
140
- echo "skipping tests because of sdist"
141
- rc=0
142
- else
143
- install_run $PLAT && rc=$? || rc=$?
144
- fi
145
-
146
- set +x
80
+ - name : before test
81
+ run : |
82
+ cd ${{ github.workspace }}/tests
83
+ export PYTHONWARNINGS = "ignore:::pip._internal.cli.base_command"
84
+ &"${{ matrix.python-version }}\\python.exe" -m pip install --user --no-warn-script-location (ls "../dist/opencv_*.whl")
85
+ if [[ $? -ne 0 ]]; then exit $?; fi
147
86
148
- #otherwise, Travis logic terminates prematurely
149
- #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
- trap ERR
151
- test "$rc " -eq 0
87
+ - name : run test
88
+ run : |
89
+ cd ${{ github.workspace }}/tests
90
+ "%PYTHON%\\python.exe " -m unittest test
152
91
153
- # - name: Upload wheels
154
- # env:
155
- # # PYPI repository
156
- # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
157
- # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
158
- # # PYPITEST repository
159
- # # TWINE_USERNAME: ${{ secrets.PYPITEST_USERNAME }}
160
- # # TWINE_PASSWORD: ${{ secrets.PYPITEST_PASSWORD }}
161
- # # TWINE_REPOSITORY_URL: 'https://test.pypi.org/legacy/'
162
- # run: |
163
- # twine upload --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/*
164
- # # Upload wheels to PYPITEST
165
- # #twine upload --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/*
92
+ - name : saving artifacts
93
+ uses : actions/upload-artifact@v2
94
+ with :
95
+ name : wheels
96
+ path : dist\opencv*.whl
0 commit comments