Skip to content

Mc revise pr type checking and linting (test on PR from forked branch) #21

Mc revise pr type checking and linting (test on PR from forked branch)

Mc revise pr type checking and linting (test on PR from forked branch) #21

Workflow file for this run

name: Python Checks
on: [pull_request]
jobs:
type_and_docstring_check:
runs-on: ubuntu-latest
steps:
- name: Checkout base branch
uses: actions/checkout@v2
with:
ref: ${{ github.base_ref }}
fetch-depth: 0
- name: Fetch head branch from fork
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
path: 'head_repo' # This checks out the forked repo into a separate directory
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy pydocstyle
- name: Find and Check Modified Python Files
run: python util/type_and_docstyle_checking.py
env:
GITHUB_BASE_REF: ${{ github.base_ref }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
HEAD_REPO_PATH: ${{ github.workspace }}/head_repo
working-directory: ${{ github.workspace }}/head_repo