Update test.yml #109
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: Linters | |
on: | |
push: | |
merge_group: | |
schedule: | |
- cron: 0 13 * * 1 | |
workflow_dispatch: | |
jobs: | |
flake8: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
cache: pip | |
python-version-file: .python-version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
python -m pip install -r requirements.txt | |
- name: Install artisatomic | |
run: | | |
python -m pip install -e . | |
- name: Lint with flake8 | |
working-directory: artisatomic/ | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
mypy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
cache: pip | |
python-version-file: .python-version | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip wheel mypy | |
python3 -m pip install -r requirements.txt | |
- name: Lint with mypy | |
run: | | |
mypy --install-types --non-interactive | |
ruff: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
cache: pip | |
python-version-file: .python-version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install ruff | |
- name: Run Ruff | |
if: always() | |
run: ruff check --output-format=github --exit-non-zero-on-fix . | |
- name: Run Ruff Format | |
if: always() | |
run: ruff format --diff . |