diff --git a/.github/workflows/mypy_primer_comment.yaml b/.github/workflows/mypy_primer_comment.yaml index b03533982..43db369f7 100644 --- a/.github/workflows/mypy_primer_comment.yaml +++ b/.github/workflows/mypy_primer_comment.yaml @@ -1,3 +1,6 @@ +# This workflow runs when the "Run mypy_primer on PR" workflow completes. +# It downloads the diff from the other workflow instances and creates +# a summary comment in the PR. name: Comment with mypy_primer diff on: diff --git a/.github/workflows/mypy_primer_pr.yaml b/.github/workflows/mypy_primer_pr.yaml index 337d83a89..62dd03ad7 100644 --- a/.github/workflows/mypy_primer_pr.yaml +++ b/.github/workflows/mypy_primer_pr.yaml @@ -1,6 +1,22 @@ +# This workflow runs mypy_primer, a tool that runs pyright on a variety +# of open-source Python projects that are known to type check with pyright. +# It builds pyright from the latest PR commit and the merge base of the PR +# and compares the output of both. It uploads the diffs as an artifact and +# creates a PR comment with the results (with the help of the +# mypy_primer_comment action). + +# This workflow definition borrows liberally from the mypy repo. The original +# workflow was designed to work in a sharded manner where n copies of +# mypy_primer are started in parallel. Each instance runs 1/n of the projects. +# For now, we run only one instance because pyright is fast, and the number +# of projects that use pyright for type checking is small. To change this in +# the future, change the 'shard_index' matrix to [0, 1, ..., n-1] and set +# 'num-shards' to n. + name: Run mypy_primer on PR on: + # Run on the creation or update of a PR. pull_request: paths: - 'packages/pyright/**' diff --git a/.github/workflows/mypy_primer_push.yaml b/.github/workflows/mypy_primer_push.yaml index e8ca9d7f1..17351fec4 100644 --- a/.github/workflows/mypy_primer_push.yaml +++ b/.github/workflows/mypy_primer_push.yaml @@ -1,6 +1,11 @@ +# This workflow runs mypy_primer, a tool that runs pyright on a variety +# of open-source Python projects that are known to type check with pyright. +# It builds pyright from the latest commit and the last release tag and +# compares the output of both. It uploads the diffs as an artifact. name: Run mypy_primer on push on: + # Run on all pushes to main. push: branches: - main @@ -8,6 +13,7 @@ on: - 'packages/pyright/**' - 'packages/pyright-internal/src/**' - 'packages/pyright-internal/typeshed-fallback/**' + # Also run manually if requested. workflow_dispatch: concurrency: