clt utils available #56
Workflow file for this run
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: Static Code Checkers | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
paths: | |
- cirkit/** | |
- tests/** | |
workflow_dispatch: | |
jobs: | |
Static-Checks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out with submodules | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Truncate pyproject for hashing | |
run: | | |
sed -n '1,/#\{80\}/p' pyproject.toml > pyproject-hash.toml | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
cache-dependency-path: pyproject-hash.toml | |
- name: Install dependencies | |
id: python-env-setup | |
run: | | |
python -m pip install -U pip | |
pip install -e .[dev] | |
- name: black | |
id: tool-black | |
if: steps.python-env-setup.outcome == 'success' | |
run: bash scripts/check.sh --tool black | |
- name: isort | |
id: tool-isort | |
if: failure() || steps.python-env-setup.outcome == 'success' | |
run: bash scripts/check.sh --tool isort | |
- name: pydocstyle | |
id: tool-pydocstyle | |
if: failure() || steps.python-env-setup.outcome == 'success' | |
run: bash scripts/check.sh --tool pydocstyle | |
- name: pylint | |
id: tool-pylint | |
if: failure() || (steps.tool-black.outcome == 'success' && steps.tool-isort.outcome == 'success') | |
run: bash scripts/check.sh --tool pylint | |
- name: mypy-cache | |
id: mypy-cache-setup | |
uses: actions/cache@v4 | |
with: | |
path: .mypy_cache | |
key: mypy_cache-${{ hashFiles('pyproject-hash.toml') }} | |
restore-keys: mypy_cache- | |
- name: mypy | |
id: tool-mypy | |
run: bash scripts/check.sh --tool mypy |