|
| 1 | +# Copyright Contributors to the OpenImageIO project. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | +# https://github.com/AcademySoftwareFoundation/OpenImageIO |
| 4 | + |
| 5 | + |
| 6 | +# This workflow is for CI for ARM-based MacOS. In an ideal world, this would |
| 7 | +# just be another matrix entry in the main CI workflow, but MacOS ARM runners |
| 8 | +# too expensive to run on every PR push. So we break into a separate workflow |
| 9 | +# to have more fine-grained control over when it runs. |
| 10 | + |
| 11 | +name: CI-Mac-ARM |
| 12 | + |
| 13 | +# This section controls when the workflow runs. |
| 14 | +on: |
| 15 | + # Run upon push, but only for tagged versions, or if the branch name |
| 16 | + # contains the substrings "macarm", "-alpha", "-beta", or is called |
| 17 | + # "release". |
| 18 | + push: |
| 19 | + tags: |
| 20 | + - v** |
| 21 | + branches: |
| 22 | + - '*macarm*' |
| 23 | + - '*alpha*' |
| 24 | + - '*beta*' |
| 25 | + - 'release' |
| 26 | + # Run for pull requests whose branch name includes "macarm" (this allows |
| 27 | + # us to test specific PRs that we think need ARM verification). |
| 28 | + pull_request: |
| 29 | + if: contains(github.head_ref, 'macarm') |
| 30 | + # Run monthly on the 27th (a few days before patch releases) to make sure we |
| 31 | + # haven't broken anything among the many PRs that didn't test on ARM. |
| 32 | + schedule: |
| 33 | + - cron: "0 8 27 * *" |
| 34 | + if: github.repository == 'AcademySoftwareFoundation/OpenImageIO' |
| 35 | + |
| 36 | +permissions: read-all |
| 37 | + |
| 38 | + |
| 39 | +jobs: |
| 40 | + # This section should remain an identical copy of the main CI workflow job |
| 41 | + # for MacOS. |
| 42 | + macos-arm: |
| 43 | + name: "${{matrix.os}} appleclang${{matrix.aclang}}/C++${{matrix.cxx_std}} py${{matrix.python_ver}} ${{matrix.desc}} boost1.76 exr3.1 ocio2.1" |
| 44 | + # Needs special runners, only run on the main repo, |
| 45 | + if: github.repository == 'AcademySoftwareFoundation/OpenImageIO' |
| 46 | + strategy: |
| 47 | + fail-fast: false |
| 48 | + matrix: |
| 49 | + include: |
| 50 | + - desc: MacOS-13 ARM |
| 51 | + os: macos-13-xlarge |
| 52 | + nametag: macos13-arm-py311 |
| 53 | + cxx_std: 17 |
| 54 | + python_ver: "3.11" |
| 55 | + aclang: 14 |
| 56 | + setenvs: export CTEST_TEST_TIMEOUT=600 USE_OPENCV=0 USE_QT=0 PARALLEL=8 |
| 57 | + runs-on: ${{ matrix.os }} |
| 58 | + env: |
| 59 | + CC: clang |
| 60 | + CXX: clang++ |
| 61 | + CMAKE_CXX_STANDARD: ${{ matrix.cxx_std }} |
| 62 | + PYTHON_VERSION: ${{ matrix.python_ver }} |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 |
| 65 | + - name: Prepare ccache timestamp |
| 66 | + id: ccache_cache_keys |
| 67 | + run: echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`" |
| 68 | + - name: ccache |
| 69 | + id: ccache |
| 70 | + uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4 |
| 71 | + with: |
| 72 | + path: /Users/runner/.ccache |
| 73 | + key: ${{github.job}}-${{matrix.nametag}}-${{ steps.ccache_cache_keys.outputs.date }} |
| 74 | + restore-keys: ${{github.job}}- |
| 75 | + - name: Build setup |
| 76 | + run: | |
| 77 | + ${{matrix.setenvs}} |
| 78 | + src/build-scripts/ci-startup.bash |
| 79 | + - name: Dependencies |
| 80 | + run: | |
| 81 | + src/build-scripts/install_homebrew_deps.bash |
| 82 | + ${{matrix.depcmds}} |
| 83 | + - name: Build |
| 84 | + run: | |
| 85 | + export PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH |
| 86 | + src/build-scripts/ci-build.bash |
| 87 | + - name: Testsuite |
| 88 | + run: src/build-scripts/ci-test.bash |
| 89 | + - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 |
| 90 | + if: failure() |
| 91 | + with: |
| 92 | + name: oiio-${{github.job}}-${{matrix.nametag}} |
| 93 | + path: | |
| 94 | + build/cmake-save |
| 95 | + build/testsuite/*/*.* |
| 96 | + !build/testsuite/oiio-images |
| 97 | + !build/testsuite/openexr-images |
| 98 | + !build/testsuite/fits-images |
| 99 | + !build/testsuite/j2kp4files_v1_5 |
0 commit comments