Skip to content

Commit b1d4914

Browse files
authored
Merge branch 'master' into dependabot/cargo/memcache-0.21.0
2 parents 6bcc29a + aa21e14 commit b1d4914

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/rust-skip.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Mirror of the `ci-status` gate in `rust.yml` for changes that workflow ignores.
2+
#
3+
# `rust.yml` skips docs-only changes via `paths-ignore`, which means it never
4+
# reports its `ci-status` check — and a required check that never reports blocks
5+
# the merge forever. This workflow triggers on exactly those paths and reports a
6+
# passing check under the same name, which is GitHub's documented pattern for
7+
# "skipped but required" checks.
8+
#
9+
# A PR touching both docs and code triggers both workflows; the real gate in
10+
# `rust.yml` still has to pass. Keep the job name identical to the one there.
11+
name: Rust (skipped)
12+
13+
on:
14+
pull_request:
15+
branches: [ "master" ]
16+
paths:
17+
- '**.md'
18+
- 'docs/**'
19+
- 'mkdocs.yml'
20+
- 'LICENSE'
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
ci-status:
27+
name: ci-status
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: No code changes to build
31+
run: echo "Docs-only change — the Rust build does not apply."

.github/workflows/rust.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
# Cross-platform build, test and lint (i686)
2525
# ---------------------------------------------------------------------------
2626
build:
27+
name: build (${{ matrix.target }})
2728
strategy:
2829
matrix:
2930
include:
@@ -99,3 +100,52 @@ jobs:
99100
name: plugin-${{ matrix.target }}
100101
path: ${{ matrix.artifact }}
101102
retention-days: 14
103+
104+
# ---------------------------------------------------------------------------
105+
# Formatting
106+
# ---------------------------------------------------------------------------
107+
# Kept out of the build matrix: rustfmt is target-independent, so running it
108+
# once is enough and it reports a failure in seconds instead of behind a build.
109+
rustfmt:
110+
name: rustfmt
111+
runs-on: ubuntu-latest
112+
permissions:
113+
contents: read
114+
steps:
115+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
116+
117+
- name: Install Rust (stable + rustfmt)
118+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
119+
with:
120+
components: rustfmt
121+
122+
- name: Check formatting
123+
run: cargo fmt --all -- --check
124+
125+
# ---------------------------------------------------------------------------
126+
# Aggregate gate: the single required status check on `master`.
127+
# ---------------------------------------------------------------------------
128+
# The `build` matrix produces check names derived from the matrix values, which
129+
# change whenever a matrix entry is edited — too brittle to require directly.
130+
# This job's name is stable, so the branch ruleset requires only this one.
131+
#
132+
# A docs-only PR never triggers this workflow at all (see `paths-ignore`), so
133+
# `rust-skip.yml` reports a passing check under the same `ci-status` name to
134+
# keep such PRs mergeable. Keep the two names in sync.
135+
ci-status:
136+
name: ci-status
137+
if: always()
138+
needs: [build, rustfmt]
139+
runs-on: ubuntu-latest
140+
permissions:
141+
contents: read
142+
steps:
143+
- name: Check job results
144+
env:
145+
BUILD_RESULT: ${{ needs.build.result }}
146+
RUSTFMT_RESULT: ${{ needs.rustfmt.result }}
147+
run: |
148+
echo "build: $BUILD_RESULT"
149+
echo "rustfmt: $RUSTFMT_RESULT"
150+
[ "$BUILD_RESULT" = "success" ] || exit 1
151+
[ "$RUSTFMT_RESULT" = "success" ] || exit 1

0 commit comments

Comments
 (0)