Skip to content

Github action #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/BuildPR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: PullRequest

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
buildMac:
name: Build macOS
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
xcode: [ Xcode_12.3 ]
sourceDist: [ 1,0 ]
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
submodules: true
- name: check
run: |
brew install python
python --version
pip --version
# use python3 as default
export PATH=/usr/local/opt/python/libexec/bin:$PATH
python --version
pip --version
- name: Build
run: |
export PATH=/usr/local/opt/python/libexec/bin:$PATH
source multibuild/common_utils.sh
source multibuild/travis_steps.sh
source travis_multibuild_customize.sh
echo $ENABLE_CONTRIB > contrib.enabled
echo $ENABLE_HEADLESS > headless.enabled
cat contrib.enabled
if [[ ${{ matrix.sourceDist }} == 1 ]]; then
python -m pip install --upgrade pip
python -m pip install scikit-build
python setup.py sdist
else
build_wheel $REPO_DIR $PLAT
fi
- name: test
run: |
export PATH=/usr/local/opt/python/libexec/bin:$PATH
if [[ ${{ matrix.sourceDist }} == 1 ]]; then
echo "skipping tests because of $sourceDist"
else
install_run $PLAT
fi
- name: post
run: |
export PATH=/usr/local/opt/python/libexec/bin:$PATH
# macpython 3.5 doesn't support recent TLS protocols which causes twine
# upload to fail, so we use the system Python to run twine
/usr/bin/python -m ensurepip --user
/usr/bin/python -m pip install --user -U pip
/usr/bin/python -m pip install --user -U -I twine

if [[ ${{ matrix.sourceDist }} == 1 ]]; then
/usr/bin/python -m twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv*
else
/usr/bin/python -m twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv*
fi
# - name: Archive artifact
# uses: actions/[email protected]
# if: ${{ success() }}
# with:
# name: openCV-python-${{ matrix.xcode }}
# path: build/release