Voltage Park migration -- set up workflows and pre-commit #3
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: Lint | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| ruff: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install ruff | |
| run: pip install ruff | |
| - name: Auto-fix with ruff | |
| run: | | |
| ruff check --fix . | |
| ruff format . | |
| - name: Commit ruff fixes | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "Auto-commit ruff fixes [skip ci]" | |
| commit_username: "Autoformatter" | |
| commit_email: "Autoformatter <actions@github.com>" | |
| mypy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup UV and python version | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.10.6" | |
| python: "3.12" | |
| - name: Install dependencies | |
| run: uv sync --group dev | |
| - name: Run mypy | |
| run: uv run mypy src/ |