|
13 | 13 | - '.github/workflows/build_wheels_macos*'
|
14 | 14 | release:
|
15 | 15 | types: [published, edited]
|
16 |
| - schedule: |
17 |
| - - cron: '0 3 * * 6' |
18 | 16 | workflow_dispatch:
|
| 17 | + workflow_call: |
| 18 | + inputs: |
| 19 | + MATRIX_BRANCH: |
| 20 | + required: true |
| 21 | + type: string |
19 | 22 |
|
20 | 23 |
|
21 | 24 | jobs:
|
@@ -57,11 +60,20 @@ jobs:
|
57 | 60 | if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
58 | 61 | echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
|
59 | 62 | fi
|
60 |
| - - name: Checkout |
61 |
| - uses: actions/checkout@v3 |
62 |
| - with: |
63 |
| - submodules: false |
64 |
| - fetch-depth: 0 |
| 63 | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then |
| 64 | + echo "CLONE_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV |
| 65 | + echo "SOURCE_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV |
| 66 | + echo "PR_AUTHOR_FORK=${{ github.event.pull_request.head.repo.full_name }}" >> $GITHUB_ENV |
| 67 | + elif [[ "${{ github.event_name }}" == "schedule" ]]; then |
| 68 | + echo "CLONE_BRANCH=${{ inputs.MATRIX_BRANCH }}" >> $GITHUB_ENV |
| 69 | + else |
| 70 | + echo "CLONE_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV |
| 71 | + fi |
| 72 | + - name: Clone |
| 73 | + run: git clone --branch ${{ env.CLONE_BRANCH }} https://github.com/opencv/opencv-python.git ${{ github.workspace }} |
| 74 | + - name: Merge with a test branch |
| 75 | + if: ${{ github.event_name == 'pull_request' }} |
| 76 | + run: cd ${{ github.workspace }} && git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" |
65 | 77 | - name: Build a package
|
66 | 78 | run: source scripts/build.sh
|
67 | 79 | - name: Saving all wheels
|
@@ -100,13 +112,25 @@ jobs:
|
100 | 112 | - name: Cleanup
|
101 | 113 | run: find . -mindepth 1 -delete
|
102 | 114 | working-directory: ${{ github.workspace }}
|
103 |
| - - name: Checkout |
104 |
| - uses: actions/checkout@v3 |
105 |
| - with: |
106 |
| - submodules: true |
107 |
| - fetch-depth: 0 |
108 | 115 | - name: Setup Environment variables
|
109 |
| - run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi |
| 116 | + run: | |
| 117 | + if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi |
| 118 | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then |
| 119 | + echo "CLONE_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV |
| 120 | + echo "SOURCE_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV |
| 121 | + echo "PR_AUTHOR_FORK=${{ github.event.pull_request.head.repo.full_name }}" >> $GITHUB_ENV |
| 122 | + elif [[ "${{ github.event_name }}" == "schedule" ]]; then |
| 123 | + echo "CLONE_BRANCH=${{ inputs.MATRIX_BRANCH }}" >> $GITHUB_ENV |
| 124 | + else |
| 125 | + echo "CLONE_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV |
| 126 | + fi |
| 127 | + - name: Clone |
| 128 | + run: git clone --branch ${{ env.CLONE_BRANCH }} https://github.com/opencv/opencv-python.git ${{ github.workspace }} |
| 129 | + - name: Merge with a test branch |
| 130 | + if: ${{ github.event_name == 'pull_request' }} |
| 131 | + run: | |
| 132 | + cd ${{ github.workspace }} && git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" |
| 133 | + git submodule update --init --recursive |
110 | 134 | - name: Download a wheel accordingly to matrix
|
111 | 135 | uses: actions/download-artifact@v3
|
112 | 136 | with:
|
@@ -154,11 +178,20 @@ jobs:
|
154 | 178 | if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
155 | 179 | echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
|
156 | 180 | fi
|
157 |
| - - name: Checkout |
158 |
| - uses: actions/checkout@v3 |
159 |
| - with: |
160 |
| - submodules: false |
161 |
| - fetch-depth: 0 |
| 181 | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then |
| 182 | + echo "CLONE_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV |
| 183 | + echo "SOURCE_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV |
| 184 | + echo "PR_AUTHOR_FORK=${{ github.event.pull_request.head.repo.full_name }}" >> $GITHUB_ENV |
| 185 | + elif [[ "${{ github.event_name }}" == "schedule" ]]; then |
| 186 | + echo "CLONE_BRANCH=${{ inputs.MATRIX_BRANCH }}" >> $GITHUB_ENV |
| 187 | + else |
| 188 | + echo "CLONE_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV |
| 189 | + fi |
| 190 | + - name: Clone |
| 191 | + run: git clone --branch ${{ env.CLONE_BRANCH }} https://github.com/opencv/opencv-python.git ${{ github.workspace }} |
| 192 | + - name: Merge with a test branch |
| 193 | + if: ${{ github.event_name == 'pull_request' }} |
| 194 | + run: cd ${{ github.workspace }} && git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" |
162 | 195 | - name: Set up Python ${{ matrix.python-version }}
|
163 | 196 | uses: actions/setup-python@v4
|
164 | 197 | with:
|
|
0 commit comments