2022-05-16 22:20:10 +08:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
unit_tests:
|
|
|
|
name: unit tests
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2023-06-15 11:55:36 +08:00
|
|
|
- os: ubuntu-22.04
|
|
|
|
rev: nightly/nvim-linux64.tar.gz
|
2022-05-16 22:20:10 +08:00
|
|
|
manager: sudo apt-get
|
2022-10-25 18:35:51 +08:00
|
|
|
packages: -y ripgrep
|
2023-06-15 11:55:36 +08:00
|
|
|
- os: ubuntu-22.04
|
|
|
|
rev: v0.7.2/nvim-linux64.tar.gz
|
2022-05-16 22:20:10 +08:00
|
|
|
manager: sudo apt-get
|
2022-10-25 18:35:51 +08:00
|
|
|
packages: -y ripgrep
|
2023-06-15 11:55:36 +08:00
|
|
|
- os: ubuntu-22.04
|
|
|
|
rev: v0.8.1/nvim-linux64.tar.gz
|
|
|
|
manager: sudo apt-get
|
|
|
|
packages: -y ripgrep
|
|
|
|
- os: macos-12
|
|
|
|
rev: nightly/nvim-macos.tar.gz
|
|
|
|
manager: brew
|
|
|
|
packages: ripgrep
|
|
|
|
- os: macos-12
|
|
|
|
rev: v0.7.2/nvim-macos.tar.gz
|
2022-05-16 22:20:10 +08:00
|
|
|
manager: brew
|
2022-10-25 18:35:51 +08:00
|
|
|
packages: ripgrep
|
2023-06-15 11:55:36 +08:00
|
|
|
- os: macos-12
|
|
|
|
rev: v0.8.1/nvim-macos.tar.gz
|
2022-05-16 22:20:10 +08:00
|
|
|
manager: brew
|
2022-10-25 18:35:51 +08:00
|
|
|
packages: ripgrep
|
2022-05-16 22:20:10 +08:00
|
|
|
steps:
|
2023-06-15 11:55:36 +08:00
|
|
|
- uses: actions/checkout@v3
|
2022-05-16 22:20:10 +08:00
|
|
|
- run: date +%F > todays-date
|
|
|
|
- name: Restore from todays cache
|
2023-06-15 11:55:36 +08:00
|
|
|
uses: actions/cache@v3
|
2022-05-16 22:20:10 +08:00
|
|
|
with:
|
|
|
|
path: _neovim
|
2023-06-15 11:55:36 +08:00
|
|
|
key: ${{ runner.os }}-${{ matrix.rev }}-${{ hashFiles('todays-date') }}
|
2022-05-16 22:20:10 +08:00
|
|
|
|
|
|
|
- name: Prepare
|
|
|
|
run: |
|
|
|
|
${{ matrix.manager }} update
|
|
|
|
${{ matrix.manager }} install ${{ matrix.packages }}
|
|
|
|
test -d _neovim || {
|
|
|
|
mkdir -p _neovim
|
2023-06-15 11:55:36 +08:00
|
|
|
curl -sL "https://github.com/neovim/neovim/releases/download/${{ matrix.rev }}" | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
|
2022-05-16 22:20:10 +08:00
|
|
|
}
|
|
|
|
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
|
|
|
|
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
|
2023-06-15 11:55:36 +08:00
|
|
|
git clone --depth 1 https://github.com/nvim-tree/nvim-web-devicons ~/.local/share/nvim/site/pack/vendor/start/nvim-web-devicons
|
2022-05-16 22:20:10 +08:00
|
|
|
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
export PATH="${PWD}/_neovim/bin:${PATH}"
|
|
|
|
export VIM="${PWD}/_neovim/share/nvim/runtime"
|
|
|
|
nvim --version
|
|
|
|
make test
|