Post-release 2024.12.08 #4389
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For more information about TARDIS pipelines, please refer to: | |
# | |
# https://tardis-sn.github.io/tardis/contributing/development/continuous_integration.html | |
name: codestyle | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request_target: | |
branches: | |
- master | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
ruff: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
if: github.event_name == 'push' | |
with: | |
fetch-depth: 0 | |
- name: Checkout PR and master branch | |
if: github.event_name == 'pull_request_target' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Setup environment | |
uses: ./.github/actions/setup_env | |
with: | |
os-label: linux-64 | |
- name: Show statistics pull request | |
if: github.event_name == 'pull_request_target' | |
run: ruff check --statistics --show-fixes $(git --no-pager diff --name-only origin/master HEAD --) | tee ruff_stats.txt | |
- name: Show entire output pull request | |
if: github.event_name == 'pull_request_target' | |
run: ruff check --output-format=concise $(git --no-pager diff --name-only origin/master HEAD --) | tee ruff_full.txt | |
- name: Show statistics push | |
if: github.event_name == 'push' | |
run: ruff check --statistics --show-fixes . | tee ruff_stats.txt | |
- name: Show entire output push | |
if: github.event_name == 'push' | |
run: ruff check --output-format=concise . | tee ruff_full.txt | |
- name: Statistics output read | |
id: ruff_stats | |
uses: juliangruber/[email protected] | |
with: | |
path: ruff_stats.txt | |
- name: Entire output read | |
id: ruff_complete | |
uses: juliangruber/[email protected] | |
with: | |
path: ruff_full.txt | |
- name: Find Comment | |
if: always() && github.event_name == 'pull_request_target' | |
uses: peter-evans/find-comment@v1 | |
id: fc | |
with: | |
issue-number: ${{ github.event.number }} | |
body-includes: I ran ruff on the latest commit | |
- name: Post comment | |
if: github.event_name == 'pull_request_target' | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
token: ${{ secrets.BOT_TOKEN }} | |
issue-number: ${{ github.event.number }} | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
edit-mode: replace | |
body: | | |
*\*beep\* \*bop\** | |
Hi human, | |
I ran ruff on the latest commit (${{ github.event.pull_request.head.sha }}). | |
Here are the outputs produced. | |
Results can also be downloaded as artifacts [**here**](${{ env.URL }}). | |
Summarised output: | |
<details> | |
```diff | |
${{ steps.ruff_stats.outputs.content }} | |
``` | |
</details> | |
Complete output(might be large): | |
<details> | |
```diff | |
${{ steps.ruff_complete.outputs.content }} | |
``` | |
</details> | |
env: | |
URL: https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}?check_suite_focus=true | |
- name: Save results artifact | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: ruff-results | |
path: | | |
ruff_full.txt | |
ruff_stats.txt | |