mirror of https://github.com/astral-sh/ruff
Run both stable and preview ecosystem checks (#8422)
Closes https://github.com/astral-sh/ruff/issues/8076 Follow-up to #8358 Doubles the amount of ecosystem checks we do, adding separate groups for the stable sections. We're likely to run into GitHub comment length restrictions if there are significant deviations. However, it should not be common for changes in stable and preview to occur at the same time, nor should it be common for linter and formatter changes to occur at the same time.
This commit is contained in:
parent
3a889f4686
commit
df4dc040de
|
|
@ -209,7 +209,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
pip install ./python/ruff-ecosystem
|
pip install ./python/ruff-ecosystem
|
||||||
|
|
||||||
- name: Run `ruff check` ecosystem check
|
- name: Run `ruff check` stable ecosystem check
|
||||||
if: ${{ needs.determine_changes.outputs.linter == 'true' }}
|
if: ${{ needs.determine_changes.outputs.linter == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
# Make executable, since artifact download doesn't preserve this
|
# Make executable, since artifact download doesn't preserve this
|
||||||
|
|
@ -218,13 +218,30 @@ jobs:
|
||||||
# Set pipefail to avoid hiding errors with tee
|
# Set pipefail to avoid hiding errors with tee
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
ruff-ecosystem check ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff --cache ./checkouts --output-format markdown --force-preview | tee ecosystem-result-check
|
ruff-ecosystem check ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff --cache ./checkouts --output-format markdown | tee ecosystem-result-check-stable
|
||||||
|
|
||||||
cat ecosystem-result-check > $GITHUB_STEP_SUMMARY
|
cat ecosystem-result-check-stable > $GITHUB_STEP_SUMMARY
|
||||||
cat ecosystem-result-check > ecosystem-result
|
echo "### Linter (stable)" > ecosystem-result
|
||||||
|
cat ecosystem-result-check-stable >> ecosystem-result
|
||||||
echo "" >> ecosystem-result
|
echo "" >> ecosystem-result
|
||||||
|
|
||||||
- name: Run `ruff format` ecosystem check
|
- name: Run `ruff check` preview ecosystem check
|
||||||
|
if: ${{ needs.determine_changes.outputs.linter == 'true' }}
|
||||||
|
run: |
|
||||||
|
# Make executable, since artifact download doesn't preserve this
|
||||||
|
chmod +x ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff
|
||||||
|
|
||||||
|
# Set pipefail to avoid hiding errors with tee
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
ruff-ecosystem check ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff --cache ./checkouts --output-format markdown --force-preview | tee ecosystem-result-check-preview
|
||||||
|
|
||||||
|
cat ecosystem-result-check-preview > $GITHUB_STEP_SUMMARY
|
||||||
|
echo "### Linter (preview)" >> ecosystem-result
|
||||||
|
cat ecosystem-result-check-preview >> ecosystem-result
|
||||||
|
echo "" >> ecosystem-result
|
||||||
|
|
||||||
|
- name: Run `ruff format` stable ecosystem check
|
||||||
if: ${{ needs.determine_changes.outputs.formatter == 'true' }}
|
if: ${{ needs.determine_changes.outputs.formatter == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
# Make executable, since artifact download doesn't preserve this
|
# Make executable, since artifact download doesn't preserve this
|
||||||
|
|
@ -233,10 +250,28 @@ jobs:
|
||||||
# Set pipefail to avoid hiding errors with tee
|
# Set pipefail to avoid hiding errors with tee
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
ruff-ecosystem format ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff --cache ./checkouts --output-format markdown --force-preview | tee ecosystem-result-format
|
ruff-ecosystem format ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff --cache ./checkouts --output-format markdown | tee ecosystem-result-format-stable
|
||||||
|
|
||||||
cat ecosystem-result-format > $GITHUB_STEP_SUMMARY
|
cat ecosystem-result-format-stable > $GITHUB_STEP_SUMMARY
|
||||||
cat ecosystem-result-format >> ecosystem-result
|
echo "### Formatter (stable)" >> ecosystem-result
|
||||||
|
cat ecosystem-result-format-stable >> ecosystem-result
|
||||||
|
echo "" >> ecosystem-result
|
||||||
|
|
||||||
|
- name: Run `ruff format` preview ecosystem check
|
||||||
|
if: ${{ needs.determine_changes.outputs.formatter == 'true' }}
|
||||||
|
run: |
|
||||||
|
# Make executable, since artifact download doesn't preserve this
|
||||||
|
chmod +x ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff
|
||||||
|
|
||||||
|
# Set pipefail to avoid hiding errors with tee
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
ruff-ecosystem format ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff --cache ./checkouts --output-format markdown --force-preview | tee ecosystem-result-format-preview
|
||||||
|
|
||||||
|
cat ecosystem-result-format-preview > $GITHUB_STEP_SUMMARY
|
||||||
|
echo "### Formatter (preview)" >> ecosystem-result
|
||||||
|
cat ecosystem-result-format-preview >> ecosystem-result
|
||||||
|
echo "" >> ecosystem-result
|
||||||
|
|
||||||
- name: Export pull request number
|
- name: Export pull request number
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,7 @@ jobs:
|
||||||
id: generate-comment
|
id: generate-comment
|
||||||
if: steps.download-ecosystem-result.outputs.found_artifact == 'true'
|
if: steps.download-ecosystem-result.outputs.found_artifact == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo '## PR Check Results' >> comment.txt
|
echo '## `ruff-ecosystem` results' >> comment.txt
|
||||||
|
|
||||||
echo "### Ecosystem" >> comment.txt
|
|
||||||
cat pr/ecosystem/ecosystem-result >> comment.txt
|
cat pr/ecosystem/ecosystem-result >> comment.txt
|
||||||
echo "" >> comment.txt
|
echo "" >> comment.txt
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue