Skip to content

Commit

Permalink
CI: move formatting related jobs in its own config
Browse files Browse the repository at this point in the history
And add cargo-sort
  • Loading branch information
dannywillems committed Feb 3, 2025
1 parent 51ad1ad commit 22a4bd9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,6 @@ jobs:
make deps
make build
run_formatting:
name: Formatting
runs-on: ubuntu-latest
strategy:
matrix:
rust_toolchain_version: ["nightly"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}

- name: Run cargo fmt
run: |
make format
run_checks:
name: Run checks and tests
# We run only one of the matrix options on the toffee `hetzner-1` self-hosted GitHub runner.
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Global configuration for formatting related jobs

on:
workflow_dispatch:
pull_request:
push:

jobs:
run_rust_formatting:
name: Formatting Rust related code
runs-on: ubuntu-latest
strategy:
matrix:
rust_toolchain_version: ["nightly"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ matrix.rust_toolchain_version }}

- name: Run cargo fmt
run: |
make format
- name: Install cargo-sort
run: cargo install cargo-sort

- name: Check Cargo.toml Sorting
run: cargo sort --check

0 comments on commit 22a4bd9

Please sign in to comment.