mirror of https://github.com/astral-sh/ruff
[ty] Link directly to typing conformance test suite when commenting the diff (#19736)
This commit is contained in:
parent
41207ec901
commit
af8587eabf
|
|
@ -24,6 +24,7 @@ env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
RUSTUP_MAX_RETRIES: 10
|
RUSTUP_MAX_RETRIES: 10
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
CONFORMANCE_SUITE_COMMIT: d4f39b27a4a47aac8b6d4019e1b0b5b3156fabdc
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
typing_conformance:
|
typing_conformance:
|
||||||
|
|
@ -40,7 +41,7 @@ jobs:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
with:
|
with:
|
||||||
repository: python/typing
|
repository: python/typing
|
||||||
ref: d4f39b27a4a47aac8b6d4019e1b0b5b3156fabdc
|
ref: ${{ env.CONFORMANCE_SUITE_COMMIT }}
|
||||||
path: typing
|
path: typing
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
|
|
@ -95,6 +96,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ${{ github.event.number }} > pr-number
|
echo ${{ github.event.number }} > pr-number
|
||||||
|
echo "${CONFORMANCE_SUITE_COMMIT}" > conformance-suite-commit
|
||||||
|
|
||||||
- name: Upload diff
|
- name: Upload diff
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
|
|
@ -107,3 +109,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: pr-number
|
name: pr-number
|
||||||
path: pr-number
|
path: pr-number
|
||||||
|
|
||||||
|
- name: Upload conformance suite commit
|
||||||
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
|
with:
|
||||||
|
name: conformance-suite-commit
|
||||||
|
path: conformance-suite-commit
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,22 @@ jobs:
|
||||||
echo "pr-number=$(<pr-number)" >> "$GITHUB_OUTPUT"
|
echo "pr-number=$(<pr-number)" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8
|
||||||
|
name: Download typing conformance suite commit
|
||||||
|
with:
|
||||||
|
name: conformance-suite-commit
|
||||||
|
run_id: ${{ github.event.workflow_run.id || github.event.inputs.workflow_run_id }}
|
||||||
|
if_no_artifact_found: ignore
|
||||||
|
allow_forks: true
|
||||||
|
|
||||||
|
- name: Parse conformance suite commit
|
||||||
|
id: conformance-suite-commit
|
||||||
|
run: |
|
||||||
|
if [[ -f conformance-suite-commit ]]
|
||||||
|
then
|
||||||
|
echo "CONFORMANCE_SUITE_COMMIT=$(<conformance-suite-commit)" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
- uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8
|
- uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8
|
||||||
name: "Download typing_conformance results"
|
name: "Download typing_conformance results"
|
||||||
id: download-typing_conformance_diff
|
id: download-typing_conformance_diff
|
||||||
|
|
@ -61,7 +77,7 @@ jobs:
|
||||||
# subsequent runs
|
# subsequent runs
|
||||||
echo '<!-- generated-comment typing_conformance_diagnostics_diff -->' >> comment.txt
|
echo '<!-- generated-comment typing_conformance_diagnostics_diff -->' >> comment.txt
|
||||||
|
|
||||||
echo '## Diagnostic diff on typing conformance tests' >> comment.txt
|
echo "## Diagnostic diff on [typing conformance tests](https://github.com/python/typing/tree/${CONFORMANCE_SUITE_COMMIT}/conformance)" >> comment.txt
|
||||||
if [ -s "pr/typing_conformance_diagnostics_diff/typing_conformance_diagnostics.diff" ]; then
|
if [ -s "pr/typing_conformance_diagnostics_diff/typing_conformance_diagnostics.diff" ]; then
|
||||||
echo '<details>' >> comment.txt
|
echo '<details>' >> comment.txt
|
||||||
echo '<summary>Changes were detected when running ty on typing conformance tests</summary>' >> comment.txt
|
echo '<summary>Changes were detected when running ty on typing conformance tests</summary>' >> comment.txt
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue