diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index cc7b0636..d63bd88e 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -18,34 +18,40 @@ on: jobs: Build: - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.platform == 'aarch64' && 'opencv-cn-lin-arm64' || 'ubuntu-22.04' }} defaults: run: shell: bash strategy: fail-fast: false - matrix: - python-version: ['3.9'] - platform: [x64] - with_contrib: [0, 1] - without_gui: [0, 1] + matrix: + python-version: ['3.9'] + platform: [x86_64, aarch64] + manylinux: [2014, 2_28] + with_contrib: [0, 1] + without_gui: [0, 1] build_sdist: [0] + exclude: + - platform: aarch64 + manylinux: 2014 + env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} - MB_ML_VER: 2014 + MB_ML_VER: ${{ matrix.manylinux }} TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20250630 + DOCKER_IMAGE: ${{ matrix.manylinux == '2014' && (matrix.platform == 'x86_64' && 'quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20250630') || '' || (matrix.platform == 'x86_64' && 'quay.io/opencv-ci/opencv-python-manylinux_2_28-x86-64:20251013') || 'quay.io/opencv-ci/opencv-python-manylinux_2_28-aarch64:20251013' }} USE_CCACHE: 0 UNICODE_WIDTH: 32 - PLAT: x86_64 + PLAT: ${{ matrix.platform == 'x86_64' && 'x86_64' || 'aarch64' }} SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -60,17 +66,18 @@ jobs: with: submodules: false fetch-depth: 0 + - name: Build a package run: source scripts/build.sh - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v4 with: - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + name: wheel-${{ matrix.platform }}-${{ matrix.manylinux }}-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl Test: needs: [Build] - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.platform == 'aarch64' && 'opencv-cn-lin-arm64' || 'ubuntu-22.04' }} defaults: run: shell: bash @@ -78,17 +85,25 @@ jobs: fail-fast: false matrix: python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] - platform: [x64] + platform: [x86_64, aarch64] + manylinux: [2014, 2_28] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] + exclude: + - platform: aarch64 + manylinux: 2014 + env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 NP_TEST_DEP_LATEST: numpy==2.2.6 CONFIG_PATH: travis_config.sh - PLAT: x86_64 + PLAT: ${{ matrix.platform == 'x86_64' && 'x86_64' || 'aarch64' }} + SDIST: ${{ matrix.build_sdist || 0 }} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -98,12 +113,13 @@ jobs: with: submodules: true fetch-depth: 0 + - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ 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 - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v4 with: - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + name: wheel-${{ matrix.platform }}-${{ matrix.manylinux }}-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests run: source scripts/install.sh diff --git a/travis_config.sh b/travis_config.sh index 2e5e1a0e..bbbd1a0b 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -39,7 +39,7 @@ else CURRENT_ARCH=$(uname -m) if [[ $CURRENT_ARCH == 'aarch64' ]]; then # To avoid network issues with pypi.org on OpenCV CN machines - export PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple + export PIP_INDEX_URL=https://pypi.org/simple echo "Running for linux aarch64" fi fi