From c0a9886493c33c35480cf2b08e2ba90ec3f6bc69 Mon Sep 17 00:00:00 2001 From: Jun Wu Date: Mon, 1 Jul 2024 10:03:51 -0700 Subject: [PATCH] Update GitHub actions Drop Python 2.7, as it is no longer available: Warning: The support for python 2.7 will be removed on June 19. Related issue: /~https://github.com/actions/setup-python/issues/672 Version 2.7 was not found in the local cache Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04. The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json Add Python 3.12 as its support was just added. Fork macOS steps from Linux due to the ARM arch change: - Rust 1.41 does not have a `aarch64-apple-darwin` version. The first Rust version that supports `aarch64-apple-darwin` is 1.49.0. - Python 3.7 to 3.10 do not have a macOS ARM version. --- .github/workflows/test.yml | 45 ++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2b1f91..44828eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,13 +7,13 @@ on: branches: [ master ] jobs: - unix: + linux: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, macos-latest ] - py: [ "2.7", "3.7", "3.8", "3.9", "3.10", "3.11" ] + os: [ ubuntu-latest ] + py: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ] rust: [ "1.41.1", "stable", "nightly" ] steps: @@ -44,13 +44,50 @@ jobs: run: | make test extensions + macos: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ macos-latest ] + py: [ "3.11", "3.12" ] + rust: [ "1.49.0", "stable", "nightly" ] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup Python ${{ matrix.py }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.py }} + - name: Setup Rust ${{ matrix.rust }} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - name: Check versions and paths + run: | + python -V ; rustc -V + echo "PATH=$PATH" + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + echo "LIBRARY_PATH=$LIBRARY_PATH" + PYTHON_LIB=$(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))") + echo "PYTHON_LIB=$PYTHON_LIB" + echo "LIBRARY_PATH=$LIBRARY_PATH:$PYTHON_LIB" >> "$GITHUB_ENV" + - name: Remove Cargo.lock + if: ${{ matrix.rust == 'stable' || matrix.rust == 'nightly' }} + run: | + rm Cargo.lock + - name: Build and test + run: | + make test extensions + windows: runs-on: ${{ matrix.os }} strategy: matrix: os: [ windows-latest ] - py: [ "2.7", "3.7", "3.8", "3.9", "3.10", "3.11"] + py: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ] rust: [ "1.41.1", "stable" ] steps: