From 1da502f58a2592b0b53bfdc5cf1a331f245aee36 Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Wed, 27 Mar 2024 11:19:39 +0300 Subject: [PATCH] moved macOS tests from CirrusCI to GitHub Signed-off-by: Alexander Piskun --- .github/workflows/analysis-coverage.yml | 36 ++++++++++++ .github/workflows/test-src-build-macos.yml | 51 +++++++++++++++++ ci/cirrus_general_ci.yml | 64 ---------------------- 3 files changed, 87 insertions(+), 64 deletions(-) diff --git a/.github/workflows/analysis-coverage.yml b/.github/workflows/analysis-coverage.yml index 890fdb3f..f279904c 100644 --- a/.github/workflows/analysis-coverage.yml +++ b/.github/workflows/analysis-coverage.yml @@ -162,6 +162,42 @@ jobs: fail_ci_if_error: true verbose: true + coverage-macos-arm: + runs-on: macos-14 + name: Coverage(macOS-14) • 🐍3.11 + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install from source + run: | + brew install --formula ./libheif/macos/libheif.rb + python3 -m pip -v install ".[dev]" + + - name: LibHeif info + run: python3 -c "import pillow_heif; print(pillow_heif.libheif_info())" + + - name: Generate coverage report + run: coverage run -m pytest && coverage xml && coverage html + + - name: HTML coverage to artifacts + uses: actions/upload-artifact@v3 + with: + name: coverage_macos_arm + path: ./htmlcov + if-no-files-found: error + + - name: Upload report to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + fail_ci_if_error: true + verbose: true + coverage-windows: runs-on: windows-2022 name: Coverage(Windows) • 🐍3.9 diff --git a/.github/workflows/test-src-build-macos.yml b/.github/workflows/test-src-build-macos.yml index d4bdac24..98a5f2b2 100644 --- a/.github/workflows/test-src-build-macos.yml +++ b/.github/workflows/test-src-build-macos.yml @@ -52,6 +52,29 @@ jobs: - name: Perform tests run: python3 -m pytest + full_macos_14: + name: macOS:14-x86_64 + runs-on: macos-14 + env: + PH_FULL_ACTION: 1 + EXP_PH_LIBHEIF_VERSION: "" + + steps: + - uses: actions/checkout@v4 + - name: Install libheif from formula + run: | + brew uninstall --force --ignore-dependencies imagemagick libheif + brew install --formula ./libheif/macos/libheif.rb + + - name: Installing Pillow-Heif + run: python3 -m pip -v install ".[dev]" + + - name: LibHeif info + run: python3 -c "import pillow_heif; print(pillow_heif.libheif_info())" + + - name: Perform tests + run: python3 -m pytest + lite_macos_12: name: macOS:12-x86_64(Pi-Heif) runs-on: macos-12 @@ -80,3 +103,31 @@ jobs: - name: Perform tests run: python3 -m pytest + + lite_macos_14: + name: macOS:14-Arm(Pi-Heif) + runs-on: macos-14 + env: + PH_LIGHT_ACTION: 1 + EXP_PH_LIBHEIF_VERSION: "" + + steps: + - uses: actions/checkout@v4 + - name: Transform to Pi-Heif + run: | + cp -r -v ./pi-heif/* . + python3 .github/transform_to-pi_heif.py + + - name: Install libheif from formula + run: | + brew uninstall --force --ignore-dependencies imagemagick libheif x265 aom + brew install --formula ./libheif/macos/libheif.rb + + - name: Installing Pi-Heif + run: python3 -m pip -v install ".[tests]" + + - name: LibHeif info + run: python3 -c "import pi_heif; print(pi_heif.libheif_info())" + + - name: Perform tests + run: python3 -m pytest diff --git a/ci/cirrus_general_ci.yml b/ci/cirrus_general_ci.yml index 9bd370cf..d5be62e2 100644 --- a/ci/cirrus_general_ci.yml +++ b/ci/cirrus_general_ci.yml @@ -1,67 +1,3 @@ -test_src_build_full_macos_arm_task: - only_if: "changesInclude( - 'ci/cirrus_general_ci.yml', - 'libheif/macos/**', - 'setup.*', - 'pyproject.toml')" - - name: From source(macOS) / macOS:12-arm64 - macos_instance: - image: ghcr.io/cirruslabs/macos-ventura-xcode:14.2 - - env: - PH_FULL_ACTION: 1 - EXP_PH_LIBHEIF_VERSION: "" - - install_libheif_script: - - brew update || true - - brew install libheif - - brew uninstall --force --ignore-dependencies imagemagick libheif - - brew install --formula ./libheif/macos/libheif.rb - install_python_3_11: - - brew install python@3.11 - install_pillow_heif_script: - - python3.11 -m pip install -U --break-system-packages pip - - python3.11 -m pip -v install --break-system-packages ".[dev]" - libheif_info_script: - - python3.11 -c "import pillow_heif; print(pillow_heif.libheif_info())" - perform_tests_script: - - python3.11 -m pytest - -test_src_build_lite_macos_arm_task: - only_if: "changesInclude( - 'ci/cirrus_general_ci.yml', - 'pi-heif/libheif/macos/**', - 'pi-heif/setup.cfg', - 'setup.py', - 'pyproject.toml')" - - name: From source(macOS) / macOS:12-arm64(Pi-Heif) - macos_instance: - image: ghcr.io/cirruslabs/macos-ventura-xcode:14.2 - - env: - PH_LIGHT_ACTION: 1 - EXP_PH_LIBHEIF_VERSION: "" - - transform_to_pi_heif_script: - - cp -r -v ./pi-heif/* . - - python3 .github/transform_to-pi_heif.py - install_libheif_script: - - brew update || true - - brew install libheif - - brew uninstall --force --ignore-dependencies imagemagick libheif x265 aom - - brew install --formula ./libheif/macos/libheif.rb - install_python_3_11: - - brew install python@3.11 - - python3.11 -m pip install -U --break-system-packages pip - install_pi_heif_script: - - python3.11 -m pip -v install --break-system-packages ".[tests]" - libheif_info_script: - - python3.11 -c "import pi_heif; print(pi_heif.libheif_info())" - perform_tests_script: - - python3.11 -m pytest - test_src_build_full_freebsd_task: only_if: "changesInclude( 'ci/cirrus_general_ci.yml',