ci: add linting step #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
paths: | |
- keywin/** | |
- tests/** | |
- .github/workflows/main.yml | |
- setup.py | |
- pyproject.toml | |
jobs: | |
install: | |
runs-on: windows-latest | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install KeyWin | |
run: pip install git+https://github.com/winstxnhdw/KeyWin | |
- name: Mini smoke test | |
run: python -c "from keywin import keyboard; keyboard.press(0x5B, 0x44)" | |
test: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
cache: pip | |
- name: Install the development dependencies | |
run: pip install -r requirements.txt | |
- name: Run linter | |
run: pylint $(git ls-files '*.py') | |
- name: Run typechecker | |
run: pyright | |
- name: Run tests | |
run: pytest | |
- name: Build the extension | |
run: python setup.py build_ext --inplace |