diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..065834c --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,102 @@ +name: CI + +on: + push: + pull_request: + +jobs: + test: + strategy: + fail-fast: false + matrix: + vim_type: ['Vim', 'Neovim'] + version: ['head', 'stable', 'oldest'] + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + download: ['available', 'never'] + + include: + - vim_type: 'Vim' + version: 'stable' + vim_version: 'v8.2.0000' + + # minpac requires Vim v8.0.0050 or later. + - vim_type: 'Vim' + version: 'oldest' + vim_version: 'v8.0.0050' + + exclude: + # minpac doesn't specify the oldest version for Neovim. + - vim_type: 'Neovim' + version: 'oldest' + + # download == 'available' is preferred, but it doesn't work well on + # Ubuntu with Vim. (Appimage versions of Vim cause troubles because + # it changes LD_LIBRARY_PATH.) + - vim_type: 'Neovim' + download: 'never' + - vim_type: 'Vim' + os: 'ubuntu-latest' + download: 'available' + - vim_type: 'Vim' + os: 'macos-latest' + download: 'never' + - vim_type: 'Vim' + os: 'windows-latest' + download: 'never' + + # FIXME: Neovim doesn't work on Ubuntu. Disable it for now. + - vim_type: 'Neovim' + os: 'ubuntu-latest' + + runs-on: '${{ matrix.os }}' + + steps: + - name: 'Checkout' + uses: 'actions/checkout@v2' + + - name: 'Setup Vim' + id: 'vim' + uses: 'thinca/action-setup-vim@v1' + with: + vim_version: '${{ matrix.vim_version || matrix.version }}' + vim_type: '${{ matrix.vim_type }}' + download: '${{ matrix.download }}' + + - name: 'Run test (Windows)' + if: ${{ startsWith(matrix.os, 'windows') }} + shell: cmd + run: | + rem # Show Vim version + ${{ steps.vim.outputs.executable }} --version + + rem # Set PATH for nmake + for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( + set InstallDir=%%i + ) + if exist "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" ( + call "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" amd64 + ) + + rem # Run the tests + cd test + if "${{ matrix.vim_type }}"=="Neovim" ( + nmake -f Make_win.mak VIMPROG=${{ steps.vim.outputs.executable }} NO_PLUGINS=--noplugin + ) else ( + nmake -f Make_win.mak VIMPROG=${{ steps.vim.outputs.executable }} + ) + + - name: 'Run test (Unix)' + if: ${{ !startsWith(matrix.os, 'windows') }} + run: | + # Show Vim version + ${{ steps.vim.outputs.executable }} --version + + # Run the tests + cd test + if [ '${{ matrix.vim_type }}' = 'Neovim' ]; then + make VIMPROG=${{ steps.vim.outputs.executable }} NO_PLUGINS='--noplugin' + else + make VIMPROG=${{ steps.vim.outputs.executable }} + fi + +# vim: sw=2 sts=2 et diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0ce93c8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,75 +0,0 @@ -language: generic -sudo: false - -cache: - directories: - - $HOME/opt - -env: - global: - - OPT=$HOME/opt - - CACHE=$OPT/cache - - BREWCACHE=$HOME/Library/Caches/Homebrew - -matrix: - include: - - os: linux - dist: focal - env: VIM=vim VIMPROG=$OPT/bin/$VIM - - os: linux - dist: focal - env: VIM=nvim VIMPROG=$VIM - - os: osx - osx_image: xcode12 - env: VIM=vim PACKAGE=vim VIMPROG=$VIM - - os: osx - osx_image: xcode12 - env: VIM=nvim PACKAGE=neovim VIMPROG=$VIM - - -install: | - if [ "$TRAVIS_OS_NAME" = "linux" ]; then - if [ "$VIM" = "vim" ]; then - git clone --depth 1 https://github.com/vim/vim - cd vim - echo -n 'Vim version: ' - git describe --tags | tee vim-ver.txt - if [ -e $OPT/vim-ver.txt ]; then - if diff $OPT/vim-ver.txt vim-ver.txt; then - cd - - return - fi - fi - ./configure --prefix=$OPT --with-features=huge --disable-gui - make - make install - cp vim-ver.txt $OPT - cd - - elif [ "$VIM" = "nvim" ]; then - # https://github.com/neovim/bot-ci#setting-up-integration-builds - eval "$(curl -Ss https://raw.githubusercontent.com/neovim/bot-ci/master/scripts/travis-setup.sh) nightly-x64" - fi - elif [ "$TRAVIS_OS_NAME" = "osx" ]; then - if [ -d $CACHE ]; then - if [ "$(echo $CACHE/*)" != "$CACHE/*" ]; then - cp $CACHE/* $BREWCACHE - fi - else - mkdir $CACHE -p - fi - (cd $BREWCACHE; ls > $HOME/list1.txt) - brew update - #brew upgrade - brew install $PACKAGE - brew cleanup -s - (cd $BREWCACHE; ls > $HOME/list2.txt) - comm -1 -3 $HOME/list1.txt $HOME/list2.txt | (cd $BREWCACHE; xargs -I{} cp {} $CACHE) - comm -2 -3 $HOME/list1.txt $HOME/list2.txt | (cd $CACHE; xargs rm -rf) - $VIM --version - fi - -script: - - cd test - - make VIMPROG=$VIMPROG - -# vim: sw=2 sts=2 et diff --git a/README.md b/README.md index 5783a06..ebdda70 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/k-takata/minpac.svg?branch=master)](https://travis-ci.org/k-takata/minpac) +[![Build status](https://github.com/k-takata/minpac/workflows/CI/badge.svg)](https://github.com/k-takata/minpac/actions) [![Build status](https://ci.appveyor.com/api/projects/status/qakftqoyx5m47ns3/branch/master?svg=true)](https://ci.appveyor.com/project/k-takata/minpac/branch/master) minpac: A minimal package manager for Vim 8 (and Neovim) diff --git a/test/Make_all.mak b/test/Make_all.mak index 3399859..5f3b6d2 100644 --- a/test/Make_all.mak +++ b/test/Make_all.mak @@ -4,7 +4,7 @@ # Options for protecting the tests against undesirable interaction with the # environment -NO_PLUGINS = --noplugin # --not-a-term +NO_PLUGINS = --noplugin --not-a-term NO_INITS = -U NONE $(NO_PLUGINS) # Individual tests.