|
36 | 36 |
|
37 | 37 | env:
|
38 | 38 | 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 }} |
39 | 55 |
|
40 | 56 | steps:
|
41 | 57 | - name: Checkout
|
|
52 | 68 | uses: actions/setup-python@v2
|
53 | 69 | with:
|
54 | 70 | 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 |
55 | 126 |
|
56 | 127 | - name: Setup MSBuild.exe
|
57 | 128 | if: ${{ matrix.os == 'windows-latest' }}
|
|
83 | 154 | shell: cmd
|
84 | 155 |
|
85 | 156 | - name: saving artifacts
|
86 |
| - if: ${{ matrix.os == 'windows-latest' }} |
87 | 157 | uses: actions/upload-artifact@v2
|
88 | 158 | with:
|
89 | 159 | name: ${{ matrix.os }}-wheels-${{ matrix.python-version }}-${{ matrix.platform }}-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
|
|
0 commit comments