|
| 1 | +name: Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + include: |
| 17 | + # Vim 7.4 |
| 18 | + - vim_version: v7.4 |
| 19 | + make_target: vim/test |
| 20 | + test_profile: vim-profile-v7.4.txt |
| 21 | + # Vim v8 |
| 22 | + - vim_version: v8.0.0000 |
| 23 | + make_target: vim/test |
| 24 | + test_profile: vim-profile-v8.0.txt |
| 25 | + # Vim master |
| 26 | + - vim_version: master |
| 27 | + make_target: vim/test |
| 28 | + test_profile: vim-profile-master.txt |
| 29 | + test_python: python3 |
| 30 | + # Installed Vim with checks |
| 31 | + - vim_version: installed |
| 32 | + make_target: test |
| 33 | + test_profile: vim-profile-installed.txt |
| 34 | + test_python: "python -m coverage run --append" |
| 35 | + |
| 36 | + env: |
| 37 | + VIM_VERSION: ${{ matrix.vim_version }} |
| 38 | + MAKE_TARGET: ${{ matrix.make_target }} |
| 39 | + TEST_PROFILE: ${{ matrix.test_profile }} |
| 40 | + TEST_PYTHON: ${{ matrix.test_python }} |
| 41 | + |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v2 |
| 44 | + with: |
| 45 | + fetch-depth: 10 |
| 46 | + |
| 47 | + - name: Install Vint |
| 48 | + if: matrix.vim_version == 'installed' |
| 49 | + run: | |
| 50 | + python -m pip install -q --user flake8 git+https://github.com/Vimjas/vint |
| 51 | +
|
| 52 | + - name: Install Vim |
| 53 | + if: matrix.vim_version != 'installed' |
| 54 | + run: | |
| 55 | + bash scripts/install-vim.sh |
| 56 | + echo "$HOME/vim/bin" >> $GITHUB_PATH |
| 57 | +
|
| 58 | + - name: Install Covimerage |
| 59 | + run: | |
| 60 | + python -m pip install -q --user covimerage |
| 61 | + python -m pip freeze |
| 62 | +
|
| 63 | + - name: Test |
| 64 | + timeout-minutes: 10 |
| 65 | + run: | |
| 66 | + uname -a |
| 67 | + which -a vim |
| 68 | + vim --version |
| 69 | + make --keep-going $MAKE_TARGET |
| 70 | +
|
| 71 | + - name: Coverage from Python |
| 72 | + if: matrix.make_target == 'test' && success() |
| 73 | + run: | |
| 74 | + # Coverage from Python (cannot be combined with non-branch data). |
| 75 | + if [[ -f .coverage_covimerage ]]; then |
| 76 | + coverage report -m |
| 77 | + coverage xml |
| 78 | + fi |
| 79 | +
|
| 80 | + - name: Codecov for Python |
| 81 | + if: matrix.make_target == 'test' && success() |
| 82 | + uses: codecov/codecov-action@v2 |
| 83 | + with: |
| 84 | + files: coverage.xml |
| 85 | + flags: python |
| 86 | + |
| 87 | + - name: Coverage from Vim |
| 88 | + if: success() |
| 89 | + run: | |
| 90 | + # Coverage from Vim. |
| 91 | + covimerage write_coverage $TEST_PROFILE |
| 92 | + coverage report -m |
| 93 | + coverage xml |
| 94 | +
|
| 95 | + - name: Codecov for Vim |
| 96 | + if: success() |
| 97 | + uses: codecov/codecov-action@v2 |
| 98 | + with: |
| 99 | + files: coverage.xml |
| 100 | + flags: vimscript |
0 commit comments