ci: Fix autofix workflow (#55004)

It also still does too much, but is at least faster while doing so.

Release Notes:

- N/A
This commit is contained in:
Finn Evers 2026-04-27 16:10:03 +02:00 committed by GitHub
parent 4c27cee963
commit d459a3ae55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 11 deletions

View file

@ -16,6 +16,9 @@ on:
jobs:
run_autofix:
runs-on: namespace-profile-16x32-ubuntu-2204
env:
CC: clang
CXX: clang++
steps:
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
@ -50,13 +53,13 @@ jobs:
tool: cargo-machete@0.7.0
- name: autofix_pr::run_autofix::run_cargo_fix
if: ${{ inputs.run_clippy }}
run: cargo fix --workspace --release --all-targets --all-features --allow-dirty --allow-staged
run: cargo fix --workspace --allow-dirty --allow-staged
- name: autofix_pr::run_autofix::run_cargo_machete_fix
if: ${{ inputs.run_clippy }}
run: cargo machete --fix
- name: autofix_pr::run_autofix::run_clippy_fix
if: ${{ inputs.run_clippy }}
run: cargo clippy --workspace --release --all-targets --all-features --fix --allow-dirty --allow-staged
run: cargo clippy --workspace --fix --allow-dirty --allow-staged
- name: autofix_pr::run_autofix::run_prettier_fix
run: ./script/prettier --write
- name: autofix_pr::run_autofix::run_cargo_fmt

View file

@ -2,7 +2,7 @@ use gh_workflow::*;
use crate::tasks::workflows::{
runners,
steps::{self, FluentBuilder, NamedJob, RepositoryTarget, TokenPermissions, named},
steps::{self, FluentBuilder, NamedJob, RepositoryTarget, TokenPermissions, named, use_clang},
vars::{self, StepOutput, WorkflowInput},
};
@ -69,9 +69,7 @@ fn run_autofix(pr_number: &WorkflowInput, run_clippy: &WorkflowInput) -> NamedJo
}
fn run_cargo_fix() -> Step<Run> {
named::bash(
"cargo fix --workspace --release --all-targets --all-features --allow-dirty --allow-staged",
)
named::bash("cargo fix --workspace --allow-dirty --allow-staged")
}
fn run_cargo_machete_fix() -> Step<Run> {
@ -79,9 +77,7 @@ fn run_autofix(pr_number: &WorkflowInput, run_clippy: &WorkflowInput) -> NamedJo
}
fn run_clippy_fix() -> Step<Run> {
named::bash(
"cargo clippy --workspace --release --all-targets --all-features --fix --allow-dirty --allow-staged",
)
named::bash("cargo clippy --workspace --fix --allow-dirty --allow-staged")
}
fn run_prettier_fix() -> Step<Run> {
@ -101,7 +97,7 @@ fn run_autofix(pr_number: &WorkflowInput, run_clippy: &WorkflowInput) -> NamedJo
.id("create-patch")
}
named::job(
named::job(use_clang(
Job::default()
.runs_on(runners::LINUX_DEFAULT)
.outputs([(
@ -123,7 +119,7 @@ fn run_autofix(pr_number: &WorkflowInput, run_clippy: &WorkflowInput) -> NamedJo
.add_step(create_patch())
.add_step(upload_patch_artifact())
.add_step(steps::cleanup_cargo_config(runners::Platform::Linux)),
)
))
}
fn commit_changes(pr_number: &WorkflowInput, autofix_job: &NamedJob) -> NamedJob {