Vidur/incident update #281
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: Pre-commit | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| cache-dependency-path: | | |
| pyproject.toml | |
| backend/pyproject.toml | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install Python dependencies | |
| run: pip install -e ".[dev]" && pip install -e backend | |
| - name: Install frontend dependencies | |
| run: cd frontend && npm ci | |
| - name: Cache pre-commit hooks | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Run pre-commit | |
| id: pre-commit | |
| run: pre-commit run --all-files --show-diff-on-failure | |
| continue-on-error: true | |
| - name: Fail with instructions if pre-commit failed | |
| if: steps.pre-commit.outcome == 'failure' | |
| run: | | |
| echo "::error::Pre-commit checks failed. Check the step above for issues, make sure main is pulled in, and run 'pre-commit run --all-files' locally. Then commit the fixes." | |
| exit 1 |