Feature/#8 add linter formatter workflow #3
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: | |
branches: [main] | |
pull_request: | |
jobs: | |
pre-commit-hooks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.12 | |
- name: Install pre-commit | |
run: pip install --upgrade pip && pip install pre-commit | |
- name: Run trailing-whitespace check | |
run: pre-commit run trailing-whitespace --all-files | |
- name: Run end-of-file-fixer check | |
run: pre-commit run end-of-file-fixer --all-files | |
- name: Run check-yaml check | |
run: pre-commit run check-yaml --all-files | |
- name: Run check-toml check | |
run: pre-commit run check-toml --all-files | |
- name : Run check-merge-conflict check | |
run: pre-commit run check-merge-conflict --all-files | |
- name: Run check-added-large-files check | |
run: pre-commit run check-added-large-files --all-files | |
spell-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Install cspell | |
run: npm install -g cspell | |
- name: Run cspell | |
run: cspell "**" --config ".vscode/cspell.json" | |
python-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: pip install -r tests/requirements-test.txt | |
- name: Run isort | |
run: isort --check-only . | |
- name: Run black | |
run: black --check . | |
- name: Run pylint | |
run: pylint . --recursive=yes --disable=duplicate-code | |
- name: Run mypy | |
run: mypy . --install-types --strict --explicit-package-bases |