From 2339eeea2661f7f58d22057a1e60effa75af88ea Mon Sep 17 00:00:00 2001 From: Mirko Galimberti Date: Sat, 25 May 2024 15:06:06 +0200 Subject: [PATCH] Sunset apple-silicon-m1 self-hosted runner, as now is supported by github-hosted runners. Use macos-13 for runs on Intel macs --- .ci/utils.sh | 17 ----------------- .github/workflows/create.yml | 30 ++++++++---------------------- .github/workflows/push.yml | 31 +++++++++++-------------------- 3 files changed, 19 insertions(+), 59 deletions(-) delete mode 100644 .ci/utils.sh diff --git a/.ci/utils.sh b/.ci/utils.sh deleted file mode 100644 index 9215fa8f..00000000 --- a/.ci/utils.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -e -x - -ensure_python_version(){ - # This function ensures that the correct python version is selected. - # It takes one argument, the python version to use. - - # On github-hosted runners, we use the setup-python action to install the correct python version, - # so we don't need to do anything. - - python_version="$1" - # if KIVY_SELF_HOSTED_USE_PYENV is set to 1, we use pyenv to select the python version - if [[ "$KIVY_SELF_HOSTED_USE_PYENV" == "1" ]]; then - source ~/.bashrc - pyenv global $python_version - fi -} \ No newline at end of file diff --git a/.github/workflows/create.yml b/.github/workflows/create.yml index f6680b34..d5af676f 100644 --- a/.github/workflows/create.yml +++ b/.github/workflows/create.yml @@ -37,7 +37,6 @@ jobs: uses: actions/checkout@v3 - name: Setup Python (Ubuntu x86_64, macOS Intel, Windows x86_64) - if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest' uses: actions/setup-python@v4 with: python-version: '3.x' @@ -65,8 +64,6 @@ jobs: env: CIBW_ARCHS: '${{ matrix.cibw_archs }}' run: | - source .ci/utils.sh - ensure_python_version 3.11 python -m pip install cibuildwheel~=2.16.2 python -m cibuildwheel --output-dir dist @@ -112,23 +109,18 @@ jobs: python: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy3.8', 'pypy3.9'] include: # We may would like to introduce tests also on windows-latest on x86 (win32 wheels)? + # macos-latest (ATM macos-14) runs on Apple Silicon, + # macos-13 runs on Intel - os: ubuntu-latest architecture: 'x64' - os: kivy-ubuntu-arm64 architecture: 'aarch64' - os: windows-latest architecture: 'x64' - - os: macos-latest + - os: macos-13 architecture: 'x64' - - os: apple-silicon-m1 - architecture: 'aarch64' - python: '3.10' - - os: apple-silicon-m1 - architecture: 'aarch64' - python: '3.11' - - os: apple-silicon-m1 + - os: macos-latest architecture: 'aarch64' - python: '3.12' runs-on: ${{ matrix.os }} steps: @@ -140,9 +132,7 @@ jobs: name: dist path: dist - - name: Setup Python (Ubuntu x86_64, macOS Intel, Windows x86_64) - # Needs to be skipped on our self-hosted runners tagged as 'apple-silicon-m1' - if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest' || matrix.os == 'apple-silicon-m1' + - name: Setup Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -155,7 +145,7 @@ jobs: architecture: ${{ matrix.architecture }} - name: Setup ant on macOS - if: (matrix.os == 'macos-latest') || (matrix.os == 'apple-silicon-m1') + if: (matrix.os == 'macos-latest') || (matrix.os == 'macos-13') run: | brew install ant @@ -168,7 +158,7 @@ jobs: run: ant all - name: Install pyjnius wheel + test prerequisites (Windows, macOS) - if: matrix.os == 'windows-latest' || matrix.os == 'macos-latest' || matrix.os == 'apple-silicon-m1' + if: matrix.os == 'windows-latest' || matrix.os == 'macos-latest' || matrix.os == 'macos-13' # --find-links=dist --no-index is needed to avoid downloading the pyjnius wheel # from the index. We need to test the wheel we just built. run: | @@ -180,16 +170,12 @@ jobs: # --find-links=dist --no-index is needed to avoid downloading the pyjnius wheel # from the index. We need to test the wheel we just built. run: | - source .ci/utils.sh - ensure_python_version ${{ matrix.python }} python -m pip install --find-links=dist --no-index pyjnius python -m pip install pyjnius[dev,ci] - name: Test wheel (Linux, macOS) - if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'kivy-ubuntu-arm64') || (matrix.os == 'macos-latest') || (matrix.os == 'apple-silicon-m1') + if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'kivy-ubuntu-arm64') || (matrix.os == 'macos-latest') || (matrix.os == 'macos-13') run: | - source .ci/utils.sh - ensure_python_version ${{ matrix.python }} cd tests CLASSPATH=../build/test-classes:../build/classes python -m pytest -v diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c3b5c95e..0c60259c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -19,10 +19,12 @@ jobs: - '11' - '20' os: + # macos-latest (ATM macos-14) runs on Apple Silicon, + # macos-13 runs on Intel - 'ubuntu-latest' - 'windows-latest' - 'macos-latest' - - 'apple-silicon-m1' + - 'macos-13' cython: - '<3' - '>=3' @@ -37,30 +39,20 @@ jobs: architecture: aarch64 - os: ubuntu-latest architecture: x86 - - os: macos-latest + - os: macos-13 architecture: aarch64 - - os: macos-latest + - os: macos-13 architecture: x86 - - os: apple-silicon-m1 - architecture: x86 - - os: apple-silicon-m1 + - os: macos-latest architecture: x64 - - os: apple-silicon-m1 - python: '3.8' - - os: apple-silicon-m1 - python: '3.9' - - os: apple-silicon-m1 - python: 'pypy-3.8' - - os: apple-silicon-m1 - python: 'pypy-3.9' + - os: macos-latest + architecture: x86 - os: windows-latest architecture: x86 python: 'pypy-3.8' - os: windows-latest architecture: x86 python: 'pypy-3.9' - - os: apple-silicon-m1 - java: '8' - os: windows-latest architecture: x86 java: '20' @@ -73,7 +65,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - architecture: ${{ (matrix.os == 'apple-silicon-m1' && matrix.architecture == 'aarch64') && 'arm64' || matrix.architecture }} - name: Setup java uses: actions/setup-java@v3 @@ -83,7 +74,7 @@ jobs: architecture: ${{ matrix.architecture }} - name: (macOS) Setup test dependencies - if: matrix.os == 'macos-latest' || matrix.os == 'apple-silicon-m1' + if: matrix.os == 'macos-latest' || matrix.os == 'macos-13' run: brew install ant - name: Build test classes via ant @@ -96,7 +87,7 @@ jobs: - name: (Linux, macOS) Force Cython version # macOS sed requires .bak filename extensions - if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'macos-latest') || (matrix.os == 'apple-silicon-m1') + if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'macos-latest') || (matrix.os == 'macos-13') run: sed -i.bak 's/"Cython"/"Cython${{matrix.cython}}"/' pyproject.toml - name: Install pyjnius with [dev, ci] extras @@ -112,7 +103,7 @@ jobs: pytest -v - name: (Linux, macOS) Test pyjnius via pytest - if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'macos-latest') || (matrix.os == 'apple-silicon-m1') + if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'macos-latest') || (matrix.os == 'macos-13') run: | cd tests CLASSPATH=../build/test-classes:../build/classes python -m pytest -v