Skip to content

Commit 83deed8

Browse files
author
Andrey Senyaev
committed
Extracted build and install+test steps into two different scripts and fixed issues
1 parent 2bab1f5 commit 83deed8

File tree

6 files changed

+52
-88
lines changed

6 files changed

+52
-88
lines changed

.github/workflows/build_wheels_linux.yml

+5-39
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
MB_PYTHON_VERSION: ${{ matrix.python-version }}
3434
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
3535
MB_ML_VER: 2014
36-
NP_TEST_DEP: numpy
36+
NP_TEST_DEP: numpy==1.19.4
3737
TRAVIS_BUILD_DIR: ${{ github.workspace }}
3838
CONFIG_PATH: travis_config.sh
3939
DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT}
@@ -56,50 +56,17 @@ jobs:
5656

5757
- name: Setup Environment variables
5858
run: |
59-
if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi
6059
if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi
6160
if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
6261
if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi
63-
if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi
6462
echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV;
6563
echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV;
6664
6765
- name: build
68-
run: |
69-
set -e
70-
# Check out and prepare the source
71-
# Multibuild doesn't have releases, so --depth would break eventually (see
72-
# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
73-
git submodule update --init multibuild
74-
source multibuild/common_utils.sh
75-
# https://github.com/matthew-brett/multibuild/issues/116
76-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
77-
source multibuild/travis_steps.sh
78-
# This sets -x
79-
# source travis_multibuild_customize.sh
80-
echo $ENABLE_CONTRIB > contrib.enabled
81-
echo $ENABLE_HEADLESS > headless.enabled
82-
set -x
83-
build_wheel $REPO_DIR $PLAT
66+
run: source scripts/build.sh
8467

8568
- name: install and test
86-
run: |
87-
set -e
88-
# Check out and prepare the source
89-
# Multibuild doesn't have releases, so --depth would break eventually (see
90-
# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
91-
git submodule update --init --recursive
92-
source multibuild/common_utils.sh
93-
# https://github.com/matthew-brett/multibuild/issues/116
94-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
95-
source multibuild/travis_steps.sh
96-
# This sets -x
97-
# source travis_multibuild_customize.sh
98-
echo $ENABLE_CONTRIB > contrib.enabled
99-
echo $ENABLE_HEADLESS > headless.enabled
100-
set -x
101-
install_run $PLAT
102-
set +x
69+
run: source scripts/install.sh
10370

10471
- name: saving artifacts
10572
uses: actions/upload-artifact@v2
@@ -133,7 +100,7 @@ jobs:
133100
MB_PYTHON_VERSION: ${{ matrix.python-version }}
134101
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
135102
MB_ML_VER: 2014
136-
NP_TEST_DEP: numpy
103+
NP_TEST_DEP: numpy==1.19.4
137104
TRAVIS_BUILD_DIR: ${{ github.workspace }}
138105
CONFIG_PATH: travis_config.sh
139106
DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT}
@@ -147,7 +114,7 @@ jobs:
147114
- name: Checkout
148115
uses: actions/checkout@v2
149116
with:
150-
submodules: true
117+
submodules: false
151118
fetch-depth: 0
152119

153120
- name: Update submodules
@@ -162,7 +129,6 @@ jobs:
162129

163130
- name: Setup Environment variables
164131
run: |
165-
if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi
166132
if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi
167133
if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
168134
echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV;

.github/workflows/build_wheels_linux_arm.yml

+7-46
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
3535
PLAT: aarch64
3636
MB_ML_VER: 2014
37-
NP_TEST_DEP: numpy
37+
NP_TEST_DEP: numpy==1.19.4
3838
TRAVIS_BUILD_DIR: ${{ github.workspace }}
3939
CONFIG_PATH: travis_config.sh
4040
DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT}
@@ -53,7 +53,7 @@ jobs:
5353
- name: Checkout
5454
uses: actions/checkout@v2
5555
with:
56-
submodules: true
56+
submodules: false
5757
fetch-depth: 0
5858

5959
- name: Setup Environment variables
@@ -62,50 +62,11 @@ jobs:
6262
echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV;
6363
echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV;
6464
65-
- name: before install
66-
run: |
67-
set -e
68-
if [[ $SDIST == 0 ]]; then
69-
# Check out and prepare the source
70-
# Multibuild doesn't have releases, so --depth would break eventually (see
71-
# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
72-
git submodule update --init multibuild
73-
source multibuild/common_utils.sh
74-
# https://github.com/matthew-brett/multibuild/issues/116
75-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
76-
source multibuild/travis_steps.sh
77-
# This sets -x
78-
# source travis_multibuild_customize.sh
79-
echo $ENABLE_CONTRIB > contrib.enabled
80-
echo $ENABLE_HEADLESS > headless.enabled
81-
echo "end"
82-
# Not interested in travis internal scripts' output
83-
fi
84-
set +x
85-
# Build and package
86-
set -x
87-
ls
88-
if [[ $SDIST == 1 ]]; then
89-
python -m pip install --upgrade pip
90-
python -m pip install scikit-build
91-
python setup.py sdist
92-
else
93-
build_wheel $REPO_DIR $PLAT
94-
fi
95-
set +x
96-
# Install and run tests
97-
set -x
98-
if [[ $SDIST == 1 ]]; then
99-
echo "skipping tests because of sdist"
100-
rc=0
101-
else
102-
install_run $PLAT && rc=$? || rc=$?
103-
fi
104-
set +x
105-
#otherwise, Travis logic terminates prematurely
106-
#https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817
107-
trap ERR
108-
test "$rc" -eq 0
65+
- name: build
66+
run: source scripts/build.sh
67+
68+
- name: install and test
69+
run: source scripts/install.sh
10970

11071
- name: saving artifacts
11172
uses: actions/upload-artifact@v2

.github/workflows/build_wheels_macos.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
MB_PYTHON_VERSION: ${{ matrix.python-version }}
3434
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
3535
MB_ML_VER: 2014
36-
NP_TEST_DEP: numpy
36+
NP_TEST_DEP: numpy==1.19.4
3737
TRAVIS_BUILD_DIR: ${{ github.workspace }}
3838
CONFIG_PATH: travis_config.sh
3939
DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT}
@@ -47,7 +47,7 @@ jobs:
4747
- name: Checkout
4848
uses: actions/checkout@v2
4949
with:
50-
submodules: true
50+
submodules: false
5151
fetch-depth: 0
5252

5353
- name: Update submodules
@@ -88,6 +88,7 @@ jobs:
8888
echo $ENABLE_HEADLESS > headless.enabled
8989
set -x
9090
build_wheel $REPO_DIR $PLAT
91+
git submodule update --init --recursive
9192
install_run $PLAT
9293
set +x
9394

.github/workflows/build_wheels_windows.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Checkout
3737
uses: actions/checkout@v2
3838
with:
39-
submodules: true
39+
submodules: false
4040
fetch-depth: 0
4141

4242
- name: Update submodules
@@ -62,6 +62,7 @@ jobs:
6262

6363
- name: before test
6464
run: |
65+
git submodule update --init --recursive
6566
cd ${{ github.workspace }}/tests
6667
&python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl")
6768
if ($LastExitCode -ne 0) {throw $LastExitCode}

scripts/build.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -e
4+
# Check out and prepare the source
5+
# Multibuild doesn't have releases, so --depth would break eventually (see
6+
# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
7+
git submodule update --init multibuild
8+
source multibuild/common_utils.sh
9+
# https://github.com/matthew-brett/multibuild/issues/116
10+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
11+
source multibuild/travis_steps.sh
12+
# This sets -x
13+
# source travis_multibuild_customize.sh
14+
echo $ENABLE_CONTRIB > contrib.enabled
15+
echo $ENABLE_HEADLESS > headless.enabled
16+
set -x
17+
build_wheel $REPO_DIR $PLAT

scripts/install.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -e
4+
# Check out and prepare the source
5+
# Multibuild doesn't have releases, so --depth would break eventually (see
6+
# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
7+
git submodule update --init --recursive
8+
source multibuild/common_utils.sh
9+
# https://github.com/matthew-brett/multibuild/issues/116
10+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
11+
source multibuild/travis_steps.sh
12+
# This sets -x
13+
# source travis_multibuild_customize.sh
14+
echo $ENABLE_CONTRIB > contrib.enabled
15+
echo $ENABLE_HEADLESS > headless.enabled
16+
set -x
17+
install_run $PLAT
18+
set +x

0 commit comments

Comments
 (0)