|
| 1 | +name: test |
| 2 | +on: |
| 3 | + push: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - 'master' |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.repository_owner == 'neovim' && github.sha || github.ref_name }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +env: |
| 13 | + PYTEST_ADDOPTS: '-vv' |
| 14 | + |
| 15 | +jobs: |
| 16 | + test: |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + node: ['3.11', '3.12'] |
| 21 | + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] |
| 22 | + include: |
| 23 | + - os: ubuntu-latest |
| 24 | + NIGHTLY: nvim-linux64.tar.gz |
| 25 | + NVIM_BIN_PATH: nvim-linux64/bin |
| 26 | + EXTRACT: tar xzf |
| 27 | + - os: macos-latest |
| 28 | + NIGHTLY: nvim-macos.tar.gz |
| 29 | + NVIM_BIN_PATH: nvim-macos/bin |
| 30 | + EXTRACT: tar xzf |
| 31 | + - os: windows-latest |
| 32 | + NIGHTLY: nvim-win64.zip |
| 33 | + NVIM_BIN_PATH: nvim-win64/bin |
| 34 | + EXTRACT: unzip |
| 35 | + |
| 36 | + runs-on: ${{ matrix.os }} |
| 37 | + |
| 38 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v3 |
| 41 | + - uses: actions/setup-python@v4 |
| 42 | + with: |
| 43 | + cache: 'pip' |
| 44 | + python-version: ${{ matrix.python }} |
| 45 | + |
| 46 | + - name: install neovim |
| 47 | + run: | |
| 48 | + curl -LO 'https://github.com/neovim/neovim/releases/download/nightly/${{ matrix.NIGHTLY }}' |
| 49 | + ${{ matrix.EXTRACT }} ${{ matrix.NIGHTLY }} |
| 50 | + echo '${{ runner.os }}' |
| 51 | +
|
| 52 | + - name: update path (bash) |
| 53 | + if: runner.os != 'Windows' |
| 54 | + run: echo "$(pwd)/${{ matrix.NVIM_BIN_PATH }}" >> $GITHUB_PATH |
| 55 | + |
| 56 | + - name: update path (windows) |
| 57 | + if: runner.os == 'Windows' |
| 58 | + run: echo "$(pwd)/${{ matrix.NVIM_BIN_PATH }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append |
| 59 | + |
| 60 | + - name: install dependencies |
| 61 | + run: | |
| 62 | + pip3 install . # Install from setup.py |
| 63 | + pip3 install -q pytest |
| 64 | +
|
| 65 | + - name: test |
| 66 | + run: | |
| 67 | + echo $PATH |
| 68 | + which nvim |
| 69 | + nvim --version |
| 70 | + python3 -m pytest |
| 71 | +
|
| 72 | + - uses: codecov/codecov-action@v3 |
| 73 | + if: runner.os == 'macOS' |
| 74 | + with: |
| 75 | + verbose: true # optional (default = false) |
| 76 | + |
| 77 | +# TODO: tox, codecov steps from old travis workflow |
| 78 | +# |
| 79 | +# env: CI_TARGET=checkqa TOXENV=checkqa,docs |
| 80 | +# script: |
| 81 | +# - tox |
| 82 | +# after_script: |
| 83 | +# - if [ $CI_TARGET = tests ]; then |
| 84 | +# set -x; |
| 85 | +# pip3 install coverage; |
| 86 | +# coverage combine; |
| 87 | +# coverage report -m; |
| 88 | +# coverage xml; |
| 89 | +# bash <(curl --retry 5 --silent --fail https://codecov.io/bash) -f coverage.xml; |
| 90 | +# set +x; |
| 91 | +# fi |
0 commit comments