8000 Added ubuntu and macos into pipeline · ArtificialZeng/opencv-python@834e9b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 834e9b3

Browse files
authored
Added ubuntu and macos into pipeline
1 parent a1be420 commit 834e9b3

File tree

1 file changed

+71
-1
lines changed

1 file changed

+71
-1
lines changed

.github/workflows/build_wheels.yml

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ jobs:
3636

3737
env:
3838
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
39+
REPO_DIR: .
40+
BUILD_COMMIT: master
41+
PROJECT_SPEC: opencv-python
42+
PLAT: x86_64
43+
MB_PYTHON_VERSION: ${{ matrix.python-version }}
44+
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
45+
MB_ML_VER: 2014
46+
NP_TEST_DEP: numpy
47+
TRAVIS_BUILD_DIR: ${{ github.workspace }}
48+
CONFIG_PATH: travis_config.sh
49+
DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT}
50+
USE_CCACHE: 1
51+
UNICODE_WIDTH: 32
52+
SDIST: ${{ matrix.build_sdist || 0}}
53+
ENABLE_HEADLESS: ${{ matrix.without_gui }}
54+
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
3955

4056
steps:
4157
- name: Checkout
@@ -52,6 +68,61 @@ jobs:
5268
uses: actions/setup-python@v2
5369
with:
5470
python-version: ${{ matrix.python-version }}
71+
72+
- name: Setup Environment variables
73+
if: ${{ matrix.os == 'ubuntu-latest' }} || ${{ matrix.os == 'macos-latest' }}
74+
run: |
75+
if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi
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
77+
if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
78+
echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV;
79+
echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV;
80+
81+
- name: before install
82+
if: ${{ matrix.os == 'ubuntu-latest' }} || ${{ matrix.os == 'macos-latest' }}
83+
run: |
84+
set -e
85+
if [[ $SDIST == 0 ]]; then
86+
# Check out and prepare the source
87+
# Multibuild doesn't have releases, so --depth would break eventually (see
88+
# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
89+
git submodule update --init multibuild
90+
source multibuild/common_utils.sh
91+
# https://github.com/matthew-brett/multibuild/issues/116
92+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
93+
source multibuild/travis_steps.sh
94+
# This sets -x
95+
# source travis_multibuild_customize.sh
96+
echo $ENABLE_CONTRIB > contrib.enabled
97+
echo $ENABLE_HEADLESS > headless.enabled
98+
echo "end"
99+
# Not interested in travis internal scripts' output
100+
fi
101+
set +x
102+
# Build and package
103+
set -x
104+
ls
105+
if [[ $SDIST == 1 ]]; then
106+
python -m pip install --upgrade pip
107+
python -m pip install scikit-build
108+
python setup.py sdist
109+
else
110+
build_wheel $REPO_DIR $PLAT
111+
fi
112+
set +x
113+
# Install and run tests
114+
set -x
115+
if [[ $SDIST == 1 ]]; then
116+
echo "skipping tests because of sdist"
117+
rc=0
118+
else
119+
install_run $PLAT && rc=$? || rc=$?
120+
fi
121+
set +x
122+
#otherwise, Travis logic terminates prematurely
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
124+
trap ERR
125+
test "$rc" -eq 0
55126
56127
- name: Setup MSBuild.exe
57128
if: ${{ matrix.os == 'windows-latest' }}
@@ -83,7 +154,6 @@ jobs:
83154
shell: cmd
84155

85156
- name: saving artifacts
86-
if: ${{ matrix.os == 'windows-latest' }}
87157
uses: actions/upload-artifact@v2
88158
with:
89159
name: ${{ matrix.os }}-wheels-${{ matrix.python-version }}-${{ matrix.platform }}-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}

0 commit comments

Comments
 (0)
0