diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..056f555 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: lint + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Setup and run pre-commit + uses: pre-commit/action@v3.0.0 + - name: Setup pdm + uses: pdm-project/setup-pdm@v3 + with: + python-version: 3.10 + cache: true + - name: Install dependencies + run: pdm install + - name: Enforce types with mypy + run: pdm run mypy torchattack