Merge branch 'mit-han-lab:main' into main #6
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 | |
| - dev | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| test_target: | |
| description: 'What to test: "pr" or "branch"' | |
| required: true | |
| type: choice | |
| options: | |
| - pr | |
| - branch | |
| pr_number: | |
| description: 'Pull Request Number (only if test_target == "pr")' | |
| required: false | |
| branch_name: | |
| description: 'Branch name (only if test_target == "branch")' | |
| default: 'main' | |
| required: false | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Show current commit | |
| run: git log -1 --oneline | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install pre-commit hook | |
| run: | | |
| python -m pip install pre-commit | |
| pre-commit install | |
| - name: Linting | |
| run: pre-commit run --all-files --show-diff-on-failure |