name: CI

on:
  push:
    branches:
      - master
  pull_request:

permissions:
  contents: read

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    strategy:
      matrix:
        vim:
          - v9.1.0000
          - v9.0.0000
          - v8.2.0000
          - v8.1.0000
          - v8.0.0000
          - v7.4
          - v7.3
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Checkout vim-themis
        uses: actions/checkout@v4
        with:
          repository: thinca/vim-themis
          path: vim-themis
          ref: v1.6.0
      - name: Setup Vim
        uses: rhysd/action-setup-vim@v1
        id: vim
        with:
          version: ${{ matrix.vim }}
      - name: Test
        env:
          THEMIS_VIM: ${{ steps.vim.outputs.executable }}
        run: ./vim-themis/bin/themis --reporter spec
