name: CI on: - push - pull_request jobs: test: name: Run tests strategy: matrix: os: - ubuntu-latest # FIX: Now macos with nightly Neovim fails to test # - macos-latest - windows-latest version: - v0.9.5 - v0.9.4 - v0.9.2 - nightly runs-on: ${{ matrix.os }} timeout-minutes: 15 steps: - uses: actions/checkout@v3 - name: Checkout plenary.nvim uses: actions/checkout@v3 with: repository: nvim-lua/plenary.nvim path: plenary.nvim - name: Checkout telescope.nvim uses: actions/checkout@v3 with: repository: nvim-telescope/telescope.nvim path: telescope.nvim - name: Install Neovim uses: rhysd/action-setup-vim@v1 id: nvim with: neovim: true version: ${{ matrix.version }} - name: Run tests (not for Windows) env: PLENARY_PATH: plenary.nvim TELESCOPE_PATH: telescope.nvim DEBUG_PLENARY: 1 EXE: ${{ steps.nvim.outputs.executable }} run: |- TEST_DIR=lua/frecency/tests/ MINIMAL_LUA=${TEST_DIR}minimal.lua NVIM=$(perl -e '$_ = $ENV{EXE}; s,\\,/,g; print') $NVIM --headless --clean -u $MINIMAL_LUA -c "PlenaryBustedDirectory $TEST_DIR {minimal_init = '$MINIMAL_LUA'}" if: matrix.os != 'windows-latest' - name: Run tests (for Windows) shell: bash env: PLENARY_PATH: plenary.nvim TELESCOPE_PATH: telescope.nvim DEBUG_PLENARY: 1 EXE: ${{ steps.nvim.outputs.executable }} run: |- # HACK: This is needed because it fails to add runtimepath's. cp -af $PLENARY_PATH/lua/plenary/ lua/ cp -af $TELESCOPE_PATH/lua/telescope/ lua/ TEST_DIR=lua/frecency/tests/ MINIMAL_LUA=${TEST_DIR}minimal.lua NVIM=$(perl -e '$_ = $ENV{EXE}; s,\\,/,g; print') attempts=0 while ! $NVIM --headless --clean -u $MINIMAL_LUA -c "PlenaryBustedDirectory $TEST_DIR {minimal_init = '$MINIMAL_LUA', timeout = 180000, sequential = true}"; do if (( attempts++ > 5 )); then exit 1 fi done if: matrix.os == 'windows-latest' - name: Type Check Code Base uses: mrcjkb/lua-typecheck-action@v0.2.0 with: checkLevel: Hint configpath: .luarc.json # NOTE: This step needs nix that seems not to work with SIP (macOS) if: matrix.os == 'ubuntu-latest'