Migrate tests to GitHub actions #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake | |
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | |
name: CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: "test on ${{ matrix.os }} ; ${{ matrix.neovim && 'neovim' || 'vim' }}" | |
strategy: | |
matrix: | |
# Testing doesn't seem to work on Windows: output log file | |
# cannot be read... | |
# os: [ubuntu-latest, macos-latest, windows-latest] | |
os: [ubuntu-latest, macos-latest] | |
neovim: [false] | |
# neovim: [false, true] | |
# TODO: Test different flavours of Vim... | |
runs-on: ${{ matrix.os }} | |
env: | |
CTAGS_VERSION: v6.1.0 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.0 | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Setup Vim | |
uses: rhysd/action-setup-vim@v1 | |
# uses: thinca/action-setup-vim@v2 | |
id: vim | |
with: | |
neovim: ${{matrix.neovim }} | |
configure-args: | | |
--with-features=huge | |
# Install universal-ctags in cache | |
- uses: actions/cache@v4 | |
id: cache-ctags | |
with: | |
path: $HOME/local | |
key: ${{ runner.os }}-ctags-${{ env.CTAGS_VERSION }} | |
# If cache is missed, re-install universal-ctags | |
- name: Install Universal ctags | |
if: steps.cache-ctags.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/universal-ctags/ctags.git | |
cd ctags | |
git checkout tags/$CTAGS_VERSION | |
builtin type -P brew &> /dev/null && brew install automake | |
./autogen.sh | |
./configure --prefix=$HOME/local | |
make -j 4 install | |
- name: Add ctags to PATH | |
run: echo "PATH=$HOME/local/bin:$PATH" >> $GITHUB_ENV | |
- name: Run tests on Linux | |
if: runner.os == 'Linux' # headless execution is required on Linux | |
run: | | |
bundle list | |
xvfb-run bundle exec rake ci | |
- name: Run tests on ${{ matrix.os }} | |
if: runner.os != 'Linux' | |
run: | | |
bundle exec rake ci |