From 648b0c7cfe6d5c22bce8fea6ec556a766020b9f5 Mon Sep 17 00:00:00 2001 From: Jongwook Choi Date: Thu, 31 Oct 2024 11:13:01 -0400 Subject: [PATCH 1/2] fix(ci): do not use matrix variables for OS-specific commands The use of `matrix.NIGHTLY`, `matrix.EXTRACT`, etc. makes CI matrix configuration difficult. Instead, let the shell script for the neovim installation step take care of OS specializations. --- .github/workflows/test.yml | 51 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b747297c..c71a965d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,21 +35,6 @@ jobs: include: - os: 'ubuntu-20.04' python-version: '3.7' - NIGHTLY: nvim-linux64.tar.gz - NVIM_BIN_PATH: nvim-linux64/bin - EXTRACT: tar xzf - - os: 'ubuntu-latest' - NIGHTLY: nvim-linux64.tar.gz - NVIM_BIN_PATH: nvim-linux64/bin - EXTRACT: tar xzf - - os: 'macos-latest' - NIGHTLY: nvim-macos-x86_64.tar.gz - NVIM_BIN_PATH: nvim-macos-x86_64/bin - EXTRACT: tar xzf - - os: 'windows-latest' - NIGHTLY: nvim-win64.zip - NVIM_BIN_PATH: nvim-win64/bin - EXTRACT: unzip name: "test (python ${{ matrix.python-version }}, ${{ matrix.os }})" runs-on: ${{ matrix.os }} @@ -60,20 +45,36 @@ jobs: cache: 'pip' python-version: ${{ matrix.python-version }} - - name: update path (bash) + - name: install neovim (Linux/macOS) if: runner.os != 'Windows' - run: echo "$(pwd)/${{ matrix.NVIM_BIN_PATH }}" >> $GITHUB_PATH + run: | + set -eu -o pipefail - - name: update path (windows) - if: runner.os == 'Windows' - run: echo "$(pwd)/${{ matrix.NVIM_BIN_PATH }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + if [[ "$RUNNER_OS" == "Linux" ]]; then + BASE="nvim-linux64" + elif [[ "$RUNNER_OS" == "macOS" ]]; then + BASE="nvim-macos-x86_64" + else + echo "$RUNNER_OS not supported"; exit 1; + fi + + curl -LO "https://github.com/neovim/neovim/releases/download/nightly/${BASE}.tar.gz" + tar xzf "${BASE}.tar.gz" + echo "RUNNER_OS = $RUNNER_OS" + $BASE/bin/nvim --version - - name: install neovim + # update $PATH for later steps + echo "$(pwd)/$BASE/bin" >> $GITHUB_PATH + + - name: install neovim (Windows) + if: runner.os == 'Windows' run: | - curl -LO 'https://github.com/neovim/neovim/releases/download/nightly/${{ matrix.NIGHTLY }}' - ${{ matrix.EXTRACT }} ${{ matrix.NIGHTLY }} - echo '${{ runner.os }}' - nvim --version + curl -LO "https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.zip" + unzip nvim-win64.zip + nvim-win64/bin/nvim --version + + # update $PATH for later steps + echo "$(pwd)/nvim-win64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: install dependencies run: | From a6175a483ec867bbe38561ddd1f9a421198c376d Mon Sep 17 00:00:00 2001 From: Jongwook Choi Date: Thu, 31 Oct 2024 10:46:27 -0400 Subject: [PATCH 2/2] fix(ci): macOS CI failing with python{3.7, 3.8, 3.9} Problem: macos-latest now points to M1 runners (macos-14-arm64) which do not support python 3.7 - 3.9. Solution: For these python versions, use the macos-12 (x86_64) runner. --- .github/workflows/test.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c71a965d..4241e6b8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,9 +32,21 @@ jobs: exclude: - os: 'ubuntu-latest' python-version: '3.7' + - os: 'macos-latest' + python-version: '3.7' + - os: 'macos-latest' + python-version: '3.8' + - os: 'macos-latest' + python-version: '3.9' include: - os: 'ubuntu-20.04' python-version: '3.7' + - os: 'macos-12' + python-version: '3.7' + - os: 'macos-12' + python-version: '3.8' + - os: 'macos-12' + python-version: '3.9' name: "test (python ${{ matrix.python-version }}, ${{ matrix.os }})" runs-on: ${{ matrix.os }}