Skip to content

Commit d9e8efd

Browse files
committed
Scheduled rolling workflows
1 parent 2585d6f commit d9e8efd

9 files changed

+348
-119
lines changed

.github/workflows/build_wheels_linux.yml

+70-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build PYPI wheels for opencv-python on Linux x86_64
1+
name: Linux x86_64
22

33
on:
44
pull_request:
@@ -13,10 +13,13 @@ on:
1313
- '.github/workflows/build_wheels_macos*'
1414
release:
1515
types: [published, edited]
16+
schedule:
17+
- cron: '0 3 * * 6'
18+
workflow_dispatch:
1619

1720

1821
jobs:
19-
build:
22+
Build:
2023
runs-on: ubuntu-20.04
2124
defaults:
2225
run:
@@ -32,7 +35,7 @@ jobs:
3235
env:
3336
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
3437
REPO_DIR: .
35-
BUILD_COMMIT: master
38+
BUILD_COMMIT: ${{ github.ref }}
3639
PROJECT_SPEC: opencv-python
3740
MB_PYTHON_VERSION: ${{ matrix.python-version }}
3841
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
@@ -46,33 +49,38 @@ jobs:
4649
SDIST: ${{ matrix.build_sdist || 0 }}
4750
ENABLE_HEADLESS: ${{ matrix.without_gui }}
4851
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
52+
ENABLE_ROLLING: 1
4953
steps:
5054
- name: Cleanup
5155
run: find . -mindepth 1 -delete
5256
working-directory: ${{ github.workspace }}
57+
- name: Setup environment
58+
run: |
59+
if [[ "${{ github.event.pull_request }}" == "true" ]]; then
60+
echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV
61+
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
62+
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
63+
fi
5364
- name: Checkout
54-
uses: actions/checkout@v2
65+
uses: actions/checkout@v3
5566
with:
5667
submodules: false
5768
fetch-depth: 0
58-
- name: Update submodules
59-
if: github.event_name == 'pull_request'
60-
run: git submodule update --remote
6169
- name: Build a package
6270
run: source scripts/build.sh
6371
- name: Saving all wheels
64-
uses: actions/upload-artifact@v2
72+
uses: actions/upload-artifact@v3
6573
with:
6674
name: wheels
6775
path: wheelhouse/opencv*.whl
6876
- name: Saving a wheel accordingly to matrix
69-
uses: actions/upload-artifact@v2
77+
uses: actions/upload-artifact@v3
7078
with:
7179
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
7280
path: wheelhouse/opencv*.whl
7381

74-
test:
75-
needs: [build]
82+
Test:
83+
needs: [Build]
7684
runs-on: ubuntu-20.04
7785
defaults:
7886
run:
@@ -97,21 +105,21 @@ jobs:
97105
run: find . -mindepth 1 -delete
98106
working-directory: ${{ github.workspace }}
99107
- name: Checkout
100-
uses: actions/checkout@v2
108+
uses: actions/checkout@v3
101109
with:
102110
submodules: true
103111
fetch-depth: 0
104112
- name: Setup Environment variables
105113
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
106114
- name: Download a wheel accordingly to matrix
107-
uses: actions/download-artifact@v2
115+
uses: actions/download-artifact@v3
108116
with:
109117
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
110118
path: wheelhouse/
111119
- name: Package installation and run tests
112120
run: source scripts/install.sh
113121

114-
build_sdist:
122+
Build_sdist:
115123
runs-on: ubuntu-20.04
116124
defaults:
117125
run:
@@ -127,7 +135,7 @@ jobs:
127135
env:
128136
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
129137
REPO_DIR: .
130-
BUILD_COMMIT: master
138+
BUILD_COMMIT: ${{ github.ref }}
131139
PROJECT_SPEC: opencv-python
132140
PLAT: x86_64
133141
MB_PYTHON_VERSION: ${{ matrix.python-version }}
@@ -142,20 +150,25 @@ jobs:
142150
SDIST: ${{ matrix.build_sdist || 0 }}
143151
ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }}
144152
ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }}
153+
ENABLE_ROLLING: 1
145154
steps:
146155
- name: Cleanup
147156
run: find . -mindepth 1 -delete
148157
working-directory: ${{ github.workspace }}
158+
- name: Setup environment
159+
run: |
160+
if [[ "${{ github.event.pull_request }}" == "true" ]]; then
161+
echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV
162+
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
163+
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
164+
fi
149165
- name: Checkout
150-
uses: actions/checkout@v2
166+
uses: actions/checkout@v3
151167
with:
152168
submodules: false
153169
fetch-depth: 0
154-
- name: Update submodules
155-
if: github.event_name == 'pull_request'
156-
run: git submodule update --remote
157170
- name: Set up Python ${{ matrix.python-version }}
158-
uses: actions/setup-python@v2
171+
uses: actions/setup-python@v4
159172
with:
160173
python-version: ${{ matrix.python-version }}
161174
architecture: ${{ matrix.platform }}
@@ -172,21 +185,51 @@ jobs:
172185
set -x
173186
echo "skipping tests because of sdist"
174187
- name: saving artifacts
175-
uses: actions/upload-artifact@v2
188+
uses: actions/upload-artifact@v3
176189
with:
177190
name: wheels
178191
path: dist/opencv*.tar.gz
179192

180-
test_release_opencv_python:
193+
Release_rolling:
194+
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
195+
needs: [Build, Build_sdist, Test]
196+
runs-on: ubuntu-20.04
197+
environment: opencv-python-rolling-release
198+
defaults:
199+
run:
200+
shell: bash
201+
steps:
202+
- uses: actions/download-artifact@v3
203+
with:
204+
name: wheels
205+
path: wheelhouse/
206+
- name: Upload wheels for opencv_python_rolling
207+
run: |
208+
python -m pip install twine
209+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* wheelhouse/opencv-python-rolling-[^h]*
210+
- name: Upload wheels for opencv_contrib_python_rolling
211+
run: |
212+
python -m pip install twine
213+
python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* wheelhouse/opencv-contrib-python-rolling-[^h]*
214+
- name: Upload wheels for opencv_python_headless_rolling
215+
run: |
216+
python -m pip install twine
217+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* wheelhouse/opencv-python-headless-rolling-*
218+
- name: Upload wheels for opencv_contrib_python_headless_rolling
219+
run: |
220+
python -m pip install twine
221+
python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* wheelhouse/opencv-contrib-python-headless-rolling-*
222+
223+
Pre-release:
181224
if: github.event_name == 'release' && github.event.release.prerelease
182-
needs: [build, build_sdist, test]
225+
needs: [Build, Build_sdist, Test]
183226
runs-on: ubuntu-20.04
184227
environment: test-opencv-python-release
185228
defaults:
186229
run:
187230
shell: bash
188231
steps:
189-
- uses: actions/download-artifact@v2
232+
- uses: actions/download-artifact@v3
190233
with:
191234
name: wheels
192235
path: wheelhouse/
@@ -195,16 +238,16 @@ jobs:
195238
python -m pip install twine
196239
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* wheelhouse/opencv-*
197240
198-
release_opencv_python:
241+
Release:
199242
if: github.event_name == 'release' && !github.event.release.prerelease
200-
needs: [build, build_sdist, test]
243+
needs: [Build, Build_sdist, Test]
201244
runs-on: ubuntu-20.04
202245
environment: opencv-python-release
203246
defaults:
204247
run:
205248
shell: bash
206249
steps:
207-
- uses: actions/download-artifact@v2
250+
- uses: actions/download-artifact@v3
208251
with:
209252
name: wheels
210253
path: wheelhouse/

.github/workflows/build_wheels_linux_arm.yml

+63-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build PYPI wheels for opencv-python on Linux ARM
1+
name: Linux ARM64
22

33
on:
44
pull_request:
@@ -13,10 +13,13 @@ on:
1313
- '.github/workflows/build_wheels_macos*'
1414
release:
1515
types: [published, edited]
16+
schedule:
17+
- cron: '0 3 * * 6'
18+
workflow_dispatch:
1619

1720

1821
jobs:
19-
build_arm:
22+
Build:
2023
runs-on: opencv-cn-lin-arm64
2124
defaults:
2225
run:
@@ -32,7 +35,7 @@ jobs:
3235
env:
3336
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
3437
REPO_DIR: .
35-
BUILD_COMMIT: master
38+
BUILD_COMMIT: ${{ github.ref }}
3639
PROJECT_SPEC: opencv-python
3740
MB_PYTHON_VERSION: ${{ matrix.python-version }}
3841
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
@@ -46,32 +49,38 @@ jobs:
4649
SDIST: ${{ matrix.build_sdist || 0 }}
4750
ENABLE_HEADLESS: ${{ matrix.without_gui }}
4851
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
52+
ENABLE_ROLLING: 1
4953
steps:
50-
- name: UID
51-
run: id -u
5254
- name: Cleanup
5355
run: find . -mindepth 1 -delete
5456
working-directory: ${{ github.workspace }}
57+
- name: Setup environment
58+
run: |
59+
if [[ "${{ github.event.pull_request }}" == "true" ]]; then
60+
echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV
61+
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
62+
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
63+
fi
5564
- name: Checkout
56-
uses: actions/checkout@v2
65+
uses: actions/checkout@v3
5766
with:
5867
submodules: false
5968
fetch-depth: 0
6069
- name: Build a package
6170
run: source scripts/build.sh
6271
- name: Saving all wheels
63-
uses: actions/upload-artifact@v2
72+
uses: actions/upload-artifact@v3
6473
with:
6574
name: wheels
6675
path: wheelhouse/opencv*.whl
6776
- name: Saving a wheel accordingly to matrix
68-
uses: actions/upload-artifact@v2
77+
uses: actions/upload-artifact@v3
6978
with:
7079
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
7180
path: wheelhouse/opencv*.whl
7281

73-
test:
74-
needs: [build_arm]
82+
Test:
83+
needs: [Build]
7584
runs-on: opencv-cn-lin-arm64
7685
defaults:
7786
run:
@@ -88,6 +97,7 @@ jobs:
8897
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
8998
MB_PYTHON_VERSION: ${{ matrix.python-version }}
9099
PLAT: aarch64
100+
BUILD_COMMIT: ${{ github.ref }}
91101
NP_TEST_DEP: numpy==1.19.4
92102
NP_TEST_DEP_LATEST: numpy==1.21.4
93103
CONFIG_PATH: travis_config.sh
@@ -97,31 +107,66 @@ jobs:
97107
- name: Cleanup
98108
run: find . -mindepth 1 -delete
99109
working-directory: ${{ github.workspace }}
110+
- name: Setup environment
111+
run: |
112+
if [[ "${{ github.event.pull_request }}" == "true" ]]; then
113+
echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV
114+
fi
100115
- name: Checkout
101-
uses: actions/checkout@v2
116+
uses: actions/checkout@v3
102117
with:
103118
submodules: true
104119
fetch-depth: 0
105120
- name: Setup Environment variables
106121
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
107122
- name: Download a wheel accordingly to matrix
108-
uses: actions/download-artifact@v2
123+
uses: actions/download-artifact@v3
109124
with:
110125
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
111126
path: wheelhouse/
112127
- name: Package installation and run tests
113128
run: source scripts/install.sh
114129

115-
test_release_opencv_python:
130+
Release_rolling:
131+
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
132+
needs: [Build, Test]
133+
runs-on: ubuntu-20.04
134+
environment: opencv-python-rolling-release
135+
defaults:
136+
run:
137+
shell: bash
138+
steps:
139+
- uses: actions/download-artifact@v3
140+
with:
141+
name: wheels
142+
path: wheelhouse/
143+
- name: Upload wheels for opencv_python_rolling
144+
run: |
145+
python -m pip install twine
146+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
147+
- name: Upload wheels for opencv_contrib_python_rolling
148+
run: |
149+
python -m pip install twine
150+
python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-*
151+
- name: Upload wheels for opencv_python_headless_rolling
152+
run: |
153+
python -m pip install twine
154+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-*
155+
- name: Upload wheels for opencv_contrib_python_headless_rolling
156+
run: |
157+
python -m pip install twine
158+
python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-*
159+
160+
Pre-release:
116161
if: github.event_name == 'release' && github.event.release.prerelease
117-
needs: [build_arm, test]
162+
needs: [Build, Test]
118163
runs-on: ubuntu-20.04
119164
environment: test-opencv-python-release
120165
defaults:
121166
run:
122167
shell: bash
123168
steps:
124-
- uses: actions/download-artifact@v2
169+
- uses: actions/download-artifact@v3
125170
with:
126171
name: wheels
127172
path: wheelhouse/
@@ -130,16 +175,16 @@ jobs:
130175
python -m pip install twine
131176
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
132177
133-
release_opencv_python:
178+
Release:
134179
if: github.event_name == 'release' && !github.event.release.prerelease
135-
needs: [build_arm, test]
180+
needs: [Build, Test]
136181
runs-on: ubuntu-20.04
137182
environment: opencv-python-release
138183
defaults:
139184
run:
140185
shell: bash
141186
steps:
142-
- uses: actions/download-artifact@v2
187+
- uses: actions/download-artifact@v3
143188
with:
144189
name: wheels
145190
path: wheelhouse/

0 commit comments

Comments
 (0)