add test #181
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: Format & Lint | |
| on: | |
| push: | |
| branches: | |
| - "pull-request/[0-9]+" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| format-and-lint: | |
| if: github.repository == 'NVIDIA/tilus' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup and Install Tilus | |
| id: setup-and-install | |
| uses: ./.github/actions/setup-environment | |
| with: | |
| python-version: '3.10' | |
| - name: Cache pre-commit environments | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
| restore-keys: | | |
| pre-commit-${{ runner.os }}- | |
| - name: Install and setup pre-commit | |
| run: | | |
| echo "Pre-commit version: $(pre-commit --version)" | |
| pre-commit install-hooks | |
| - name: Run pre-commit checks | |
| run: | | |
| echo "Running all pre-commit hooks (skipping commit signature check)..." | |
| SKIP=check-commit-signature pre-commit run --all-files --show-diff-on-failure | |
| - name: Check for uncommitted changes | |
| run: | | |
| if [[ -n $(git status --porcelain) ]]; then | |
| echo "❌ Files were modified by pre-commit hooks. Please run 'pre-commit run --all-files' locally and commit the changes." | |
| echo "Modified files:" | |
| git status --porcelain | |
| echo "Showing diff:" | |
| git diff | |
| exit 1 | |
| else | |
| echo "✅ No files were modified - all checks passed!" | |
| fi |