Skip to content

Commit 648b0c7

Browse files
committed
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.
1 parent 4813ce6 commit 648b0c7

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

.github/workflows/test.yml

+26-25
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,6 @@ jobs:
3535
include:
3636
- os: 'ubuntu-20.04'
3737
python-version: '3.7'
38-
NIGHTLY: nvim-linux64.tar.gz
39-
NVIM_BIN_PATH: nvim-linux64/bin
40-
EXTRACT: tar xzf
41-
- os: 'ubuntu-latest'
42-
NIGHTLY: nvim-linux64.tar.gz
43-
NVIM_BIN_PATH: nvim-linux64/bin
44-
EXTRACT: tar xzf
45-
- os: 'macos-latest'
46-
NIGHTLY: nvim-macos-x86_64.tar.gz
47-
NVIM_BIN_PATH: nvim-macos-x86_64/bin
48-
EXTRACT: tar xzf
49-
- os: 'windows-latest'
50-
NIGHTLY: nvim-win64.zip
51-
NVIM_BIN_PATH: nvim-win64/bin
52-
EXTRACT: unzip
5338

5439
name: "test (python ${{ matrix.python-version }}, ${{ matrix.os }})"
5540
runs-on: ${{ matrix.os }}
@@ -60,20 +45,36 @@ jobs:
6045
cache: 'pip'
6146
python-version: ${{ matrix.python-version }}
6247

63-
- name: update path (bash)
48+
- name: install neovim (Linux/macOS)
6449
if: runner.os != 'Windows'
65-
run: echo "$(pwd)/${{ matrix.NVIM_BIN_PATH }}" >> $GITHUB_PATH
50+
run: |
51+
set -eu -o pipefail
6652
67-
- name: update path (windows)
68-
if: runner.os == 'Windows'
69-
run: echo "$(pwd)/${{ matrix.NVIM_BIN_PATH }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
53+
if [[ "$RUNNER_OS" == "Linux" ]]; then
54+
BASE="nvim-linux64"
55+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
56+
BASE="nvim-macos-x86_64"
57+
else
58+
echo "$RUNNER_OS not supported"; exit 1;
59+
fi
60+
61+
curl -LO "https://github.com/neovim/neovim/releases/download/nightly/${BASE}.tar.gz"
62+
tar xzf "${BASE}.tar.gz"
63+
echo "RUNNER_OS = $RUNNER_OS"
64+
$BASE/bin/nvim --version
7065
71-
- name: install neovim
66+
# update $PATH for later steps
67+
echo "$(pwd)/$BASE/bin" >> $GITHUB_PATH
68+
69+
- name: install neovim (Windows)
70+
if: runner.os == 'Windows'
7271
run: |
73-
curl -LO 'https://github.com/neovim/neovim/releases/download/nightly/${{ matrix.NIGHTLY }}'
74-
${{ matrix.EXTRACT }} ${{ matrix.NIGHTLY }}
75-
echo '${{ runner.os }}'
76-
nvim --version
72+
curl -LO "https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.zip"
73+
unzip nvim-win64.zip
74+
nvim-win64/bin/nvim --version
75+
76+
# update $PATH for later steps
77+
echo "$(pwd)/nvim-win64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
7778
7879
- name: install dependencies
7980
run: |

0 commit comments

Comments
 (0)