Files
autogen/.github/workflows/pre-commit.yml
Davor Runje 4af0440730 Update GitHub actions (#2078)
* Add mypy check in pre-commit

* Add mypy check in pre-commit

* bug fix

* CI fix

* add python version matrix for checking types in CI

* update github actions

* revert some accidental changes

* revert some accidental changes

* revert some accidental changes

* revert some accidental changes

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2024-03-20 17:18:11 +00:00

33 lines
839 B
YAML

name: Code formatting
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on pull request or merge
pull_request:
merge_group:
types: [checks_requested]
defaults:
run:
shell: bash
permissions: {}
# actions: read
# checks: read
# contents: read
# deployments: read
jobs:
pre-commit-check:
runs-on: ubuntu-latest
env:
SKIP: "mypy"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Set $PY environment variable
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v3.0.1