name: test on linux

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
    steps:
      - name: checkout
        uses: actions/checkout@v1
        with:
          fetch-depth: 1

      - name: install zsh
        run: sudo apt-get install -y zsh

      - name: test completion
        run: cd test && zsh -f runtests.zsh fzftab.ztst

      - name: build binary module
        run: zsh -fc 'source ./fzf-tab.zsh && build-fzf-tab-module'

      - name: test binary module
        run: cd test && zsh -f runtests.zsh fzftab.ztst