Skip to content

Merge pull request #1457 from FastLED/feat/fractional-ci-fbuild #2360

Merge pull request #1457 from FastLED/feat/fractional-ci-fbuild

Merge pull request #1457 from FastLED/feat/fractional-ci-fbuild #2360

Workflow file for this run

name: Formatting
on:
workflow_dispatch: {}
workflow_call:
inputs:
ref:
type: string
required: false
default: ""
push:
branches: [main]
pull_request:
branches: [main]
# Auto-cancel superseded PR runs: pushing again to a feature branch
# supersedes the in-flight run instead of queueing behind it. Non-PR
# events key on run_id so each gets its own group -- a shared group keeps
# only ONE pending run, which would silently drop queued main SHAs.
concurrency:
group: fmt.yml-${{ inputs.ref != '' && github.run_id || (github.event_name == 'pull_request' && github.ref || github.run_id) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
fmt:
name: Formatting
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- name: Setup soldr
id: setup-soldr
uses: zackees/setup-soldr@v0
with:
cache: true
build-cache: true
target-cache: false
prebuild-deps: none
# Opt out of the implicit `SOLDR_LINKER=fast` injection so cargo /
# rust-toolchain.toml stays in charge. Silences the routine
# "defaulting SOLDR_LINKER=fast" warning (issue #400 /
# setup-soldr#377). `cargo fmt` does not link anything so this
# is purely cosmetic, but it removes the annotation.
linker: platform-default
# setup-soldr provisions the pinned toolchain with profile=minimal,
# which omits rustfmt. Without this step, `cargo fmt` silently falls
# back to the runner's preinstalled (newer) stable rustfmt, whose
# import-sorting/width rules differ from the pinned 1.95.0 — every
# cache-miss run then fails with diffs the pinned toolchain does not
# produce.
- name: Install rustfmt for the pinned toolchain
run: soldr rustup component add rustfmt
- name: Check formatting
run: soldr cargo fmt --all -- --check