summaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
blob: 28cfedacd998d831440aa6ed9262aa815dd5838b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
name: CI
on:  # yamllint disable-line rule:truthy
  push:
    branches: [ master ]  # yamllint disable-line rule:brackets
    tags:
      - v[0-9]+.[0-9]+.x
      - v[0-9]+.[0-9]+.[0-9]+
  pull_request:
    branches: [ master ]  # yamllint disable-line rule:brackets

jobs:
  build_image:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build docker run image
        shell: bash
        env:
          DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
          DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
        run: ./run-tests --build-image
  test_ale:
    needs: build_image
    runs-on: ubuntu-latest
    strategy:
      matrix:
        vim-version:
          - '--vim-80-only'
          - '--vim-90-only'
          - '--neovim-06-only'
          - '--neovim-08-only'
          - '--linters-only'
    steps:
      - uses: actions/checkout@v4
      - name: Run tests
        run: ./run-tests -v ${{ matrix.vim-version }}
  test_ale_windows:
    runs-on: windows-latest
    steps:
      - name: Configure Git
        # Stop git from changing newlines
        run: git config --global core.autocrlf input
      - uses: actions/checkout@v4
      - name: Try to Restore Vim
        id: cache-vim
        uses: actions/cache@v3
        with:
          path: vim
          key: ${{ runner.os }}-vim
      - name: Install Vim
        if: steps.cache-vim.outputs.cache-hit != 'true'
        shell: pwsh
        run: >-
          if (!(Test-Path -Path vim)){
            Add-Type -A System.IO.Compression.FileSystem
            Invoke-WebRequest http://ftp.vim.org/pub/vim/pc/vim80-586w32.zip `
              -OutFile vim.zip
            [IO.Compression.ZipFile]::ExtractToDirectory('vim.zip', 'vim')
            Invoke-WebRequest http://ftp.vim.org/pub/vim/pc/vim80-586rt.zip `
              -OutFile rt.zip
            [IO.Compression.ZipFile]::ExtractToDirectory('rt.zip', 'vim')
          }
      - name: Try to Restore Vader
        id: cache-vader
        uses: actions/cache@v3
        with:
          path: vader
          key: ${{ runner.os }}-vader
      - name: Install Vader
        if: steps.cache-vader.outputs.cache-hit != 'true'
        shell: pwsh
        run: >-
          if (!(Test-Path -Path vader)){
            git clone https://github.com/junegunn/vader.vim vader 2> $null
            cd vader
            git checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af 2> $null
          }
      - name: Run tests
        # yamllint disable rule:line-length
        run: |
          vim\vim\vim80\vim.exe -u test\vimrc "+Vader! test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*.vader"
        # yamllint enable rule:line-length