Skip to content

Lint and Test

Lint and Test #1

Workflow file for this run

name: Lint and Test
on:
workflow_dispatch: # Enables manual triggering
inputs:
python_only:
description: 'Run only Python checks'
required: false
type: boolean
default: false
vim_only:
description: 'Run only Vim checks'
required: false
type: boolean
default: false
push:
paths:
- 'python/plugin.py'
- 'plugin/wordnet-cmp.vim'
pull_request:
paths:
- 'python/plugin.py'
- 'plugin/wordnet-cmp.vim'
jobs:
python-check:
if: "!inputs.vim_only"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest wn
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
flake8 python/plugin.py --count --max-complexity=10 --max-line-length=100 --statistics
- name: Test with pytest
run: |
pytest python/plugin.py
vim-check:
if: "!inputs.python_only"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install vint
run: |
python -m pip install --upgrade pip
pip install vim-vint
- name: Lint Vim script
run: |
vint plugin/wordnet-cmp.vim