From e053573acafe8c0251b83a0caa210f5db4c76bdc 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 | 28 ++++++---------------------- .github/workflows/push.yml | 29 +++++++++-------------------- 3 files changed, 15 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..980a1a20 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 @@ -118,17 +115,10 @@ jobs: 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 +130,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 +143,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 +156,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 +168,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..2b938197 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -22,7 +22,7 @@ jobs: - 'ubuntu-latest' - 'windows-latest' - 'macos-latest' - - 'apple-silicon-m1' + - 'macos-13' cython: - '<3' - '>=3' @@ -37,30 +37,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-13 + 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 +63,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 +72,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 +85,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 +101,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