fix #43: turn on lint, code cleanup and minor refactoring #292
Workflow file for this run
This file contains hidden or 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: "AutoTest" | |
| on: | |
| workflow_dispatch: # can trigger manually | |
| pull_request: # can trigger on pull requests | |
| push: # can trigger on pushes | |
| branches: | |
| - main | |
| jobs: | |
| autotest: | |
| name: Pytest check | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/huawei-cpllab/pydsl-ci:latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Editable install | |
| shell: bash | |
| run: pip install -e . | |
| - name: Run pytest | |
| shell: bash | |
| run: pytest | |
| formattest: | |
| name: Code formatting check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12.x' | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Cache pip | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} | |
| - name: Install Hatch and Ruff | |
| shell: bash | |
| run: pip install hatch ruff | |
| - name: Code formatting check | |
| shell: bash | |
| run: hatch fmt -f --check | |
| - name: Ruff lint check | |
| shell: bash | |
| run: hatch run ruff check |