Просмотр исходного кода

Add a github action to run tests (#37)

Yegappan Lakshmanan 4 лет назад
Родитель
Сommit
6472cff95e
3 измененных файлов с 50 добавлено и 2 удалено
  1. 47 0
      .github/workflows/unittests.yml
  2. 2 1
      test/run_mru_tests.cmd
  3. 1 1
      test/run_mru_tests.sh

+ 47 - 0
.github/workflows/unittests.yml

@@ -0,0 +1,47 @@
+name: unit-tests
+on: [push, pull_request]
+jobs:
+  linux:
+    name: linux
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        vim:
+          - v8.2.2489
+          - v8.2.0000
+          - v8.1.0000
+          - v8.0.0000
+          - v7.4
+    steps:
+      - name: Checkout Code
+        uses: actions/checkout@v2
+      - name: Setup Vim
+        uses: rhysd/action-setup-vim@v1
+        id: vim
+        with:
+          version: ${{ matrix.vim }}
+      - name: Run Tests
+        run: |
+          uname -a
+          export VIM=${{ steps.vim.outputs.executable }}
+          $VIM --version
+          cd test
+          ./run_mru_tests.sh
+  windows:
+    name: windows
+    runs-on: windows-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Download Vim
+        shell: PowerShell
+        run: Invoke-WebRequest -Uri https://github.com/vim/vim-win32-installer/releases/download/v8.2.2488/gvim_8.2.2488_x64.zip -OutFile vim.zip
+      - name: Extract vim
+        shell: PowerShell
+        run: Expand-Archive -Path vim.zip -DestinationPath $env:USERPROFILE
+      - name: Run Tests
+        run: |
+          $env:PATH = $env:PATH + ';' + $env:USERPROFILE + '\vim\vim82'
+          Get-ComputerInfo -Property Windows*
+          vim --version
+          cd test
+          .\run_mru_tests.cmd

+ 2 - 1
test/run_mru_tests.cmd

@@ -3,7 +3,8 @@
 REM Script to run the unit-tests for the MRU Vim plugin on MS-Windows
 
 SETLOCAL
-SET VIM="C:\Program Files (x86)\vim\vim82\vim.exe"
+SET VIM="vim.exe"
+REM SET VIM="C:\Program Files (x86)\vim\vim82\vim.exe"
 REM SET VIM="C:\Program Files (x86)\vim\vim73\vim.exe"
 SET VIM_CMD=%VIM% -N -u NONE -U NONE -i NONE
 

+ 1 - 1
test/run_mru_tests.sh

@@ -2,7 +2,7 @@
 
 # Script to run the unit-tests for the MRU Vim plugin
 
-VIM=/usr/bin/vim
+VIM=${VIM:=/usr/bin/vim}
 VIM_CMD="$VIM -N -u NONE -U NONE -i NONE"
 
 $VIM_CMD -S unit_tests.vim