diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14120ce..dc29751 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,107 +1,55 @@ -name: test +name: Test on: - schedule: - - cron: "0 7 * * 0" push: branches: - main - paths: - - "**/*.md" - - "**/*.ts" - - "**/*.vim" - - ".github/workflows/test.yml" - - "deno.jsonc" pull_request: paths: - - "**/*.md" - - "**/*.ts" - - "**/*.vim" - - ".github/workflows/test.yml" + - "**.md" + - "**.ts" + - "**.vim" - "deno.jsonc" + - ".github/workflows/test.yml" + workflow_dispatch: + inputs: + denops_branch: + description: 'Denops branch to test' + required: false + default: 'main' defaults: run: shell: bash --noprofile --norc -eo pipefail {0} +env: + DENOPS_BRANCH: ${{ github.event.inputs.denops_branch || 'main' }} + jobs: check: strategy: matrix: runner: - ubuntu-latest - version: + deno_version: - "1.x" runs-on: ${{ matrix.runner }} steps: - run: git config --global core.autocrlf false if: runner.os == 'Windows' - - uses: actions/checkout@v2 - - uses: denoland/setup-deno@v1 + - uses: actions/checkout@v4 + - uses: denoland/setup-deno@v1.1.4 with: - deno-version: "${{ matrix.version }}" + deno-version: "${{ matrix.deno_version }}" + - uses: actions/cache@v4 + with: + key: deno-${{ hashFiles('**/*') }} + restore-keys: deno- + path: | + /home/runner/.cache/deno/deps/https/deno.land - name: Lint check run: deno lint - name: Format check run: deno fmt --check - name: Type check run: deno task check - - test: - strategy: - matrix: - runner: - - windows-latest - - macos-latest - - ubuntu-latest - version: - - "1.32.0" - - "1.x" - host_version: - - vim: "v9.0.1499" - nvim: "v0.8.0" - runs-on: ${{ matrix.runner }} - steps: - - run: git config --global init.defaultBranch main - - run: git config --global core.autocrlf false - if: runner.os == 'Windows' - - uses: actions/checkout@v2 - with: - path: "./repo" - - uses: actions/checkout@v2 - with: - repository: "vim-denops/denops.vim" - path: "./denops.vim" - - uses: denoland/setup-deno@v1 - with: - deno-version: "${{ matrix.version }}" - - uses: thinca/action-setup-vim@v1 - id: vim - with: - vim_type: "Vim" - vim_version: "${{ matrix.host_version.vim }}" - download: "${{ (runner.os == 'Linux' && 'never') || 'available' }}" - - name: Check Vim - run: | - echo ${DENOPS_TEST_VIM} - ${DENOPS_TEST_VIM} --version - env: - DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable_path }} - - uses: thinca/action-setup-vim@v1 - id: nvim - with: - vim_type: "Neovim" - vim_version: "${{ matrix.host_version.nvim }}" - - name: Check Neovim - run: | - echo ${DENOPS_TEST_NVIM} - ${DENOPS_TEST_NVIM} --version - env: - DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }} - - name: Test - working-directory: ./repo - run: deno task test - env: - DENOPS_TEST_DENOPS_PATH: "../denops.vim" - DENOPS_TEST_VIM_EXECUTABLE: ${{ steps.vim.outputs.executable_path }} - DENOPS_TEST_NVIM_EXECUTABLE: ${{ steps.nvim.outputs.executable }}