@@ -108,81 +108,11 @@ env:
108108 PYTHON_VERSION : " 3.13.1"
109109
110110jobs :
111- auto_format_pr :
112- if : ${{ github.event_name == 'pull_request' }}
113- runs-on : ubuntu-latest
114- permissions :
115- contents : write
116- pull-requests : write
117- checks : read
118- steps :
119- - name : Checkout PR branch
120- uses : actions/checkout@v5
121- with :
122- ref : ${{ github.event.pull_request.head.ref }}
123- repository : ${{ github.event.pull_request.head.repo.full_name }}
124- token : ${{ github.token }}
125- fetch-depth : 0
126-
127- - name : Setup Rust
128- uses : dtolnay/rust-toolchain@stable
129- with :
130- components : rustfmt
131-
132- - name : Run cargo fmt
133- run : cargo fmt --all
134-
135- - name : Configure git
136- run : |
137- git config user.name "github-actions[bot]"
138- git config user.email "github-actions[bot]@users.noreply.github.com"
139-
140- - name : git add
141- run : git add -u
142-
143- - name : git commit
144- id : git-commit
145- run : git commit -m "run `cargo fmt --all`"
146- continue-on-error : true # Will fail if nothing to commit
147-
148- - name : Comment on PR
149- if : ${{ steps.git-commit.outcome == 'success' }}
150- uses : marocchino/sticky-pull-request-comment@v2
151- with :
152- number : ${{ github.event.pull_request.number }}
153- message : |
154- **Code has been automatically formatted**
155-
156- The code in this PR has been formatted using `cargo fmt --all`.
157-
158- You may need to pull the latest changes before pushing again:
159- ```bash
160- git pull origin ${{ github.event.pull_request.head.ref }}
161- ```
162-
163- **Triggered by commit:** `${{ github.event.pull_request.head.sha }}`
164- **Last formatted:** ${{ github.event.pull_request.updated_at }}
165- **Run**: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
166-
167- - name : git push
168- run : git push origin HEAD:${{ env.HEAD_REF }}
169- env :
170- HEAD_REF : ${{ github.event.pull_request.head.ref }}
171- if : steps.git-commit.outcome == 'success'
172-
173- # This step is not really needed as the earlier push should cancel this run anyways.
174- # But we are making sure that we abort if we had badly formatted files.
175- - name : Exit if changed
176- run : exit 1
177- if : ${{ steps.git-commit.outcome == 'success' }}
178-
179111 rust_tests :
180- if : ${{ !cancelled() && ! contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
112+ if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
181113 env :
182114 RUST_BACKTRACE : full
183115 name : Run rust tests
184- needs :
185- - auto_format_pr
186116 runs-on : ${{ matrix.os }}
187117 timeout-minutes : ${{ contains(matrix.os, 'windows') && 45 || 35 }}
188118 strategy :
@@ -244,10 +174,8 @@ jobs:
244174 if : runner.os == 'macOS'
245175
246176 exotic_targets :
247- if : ${{ !cancelled() && ! contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
177+ if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
248178 name : Ensure compilation on various targets
249- needs :
250- - auto_format_pr
251179 runs-on : ubuntu-latest
252180 timeout-minutes : 30
253181 steps :
@@ -307,12 +235,10 @@ jobs:
307235 # args: --ignore-rust-version
308236
309237 snippets_cpython :
310- if : ${{ !cancelled() && ! contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
238+ if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
311239 env :
312240 RUST_BACKTRACE : full
313241 name : Run snippets and cpython tests
314- needs :
315- - auto_format_pr
316242 runs-on : ${{ matrix.os }}
317243 timeout-minutes : ${{ contains(matrix.os, 'windows') && 45 || 35 }}
318244 strategy :
@@ -383,8 +309,6 @@ jobs:
383309
384310 lint :
385311 name : Check Rust code with clippy
386- needs :
387- - auto_format_pr
388312 runs-on : ubuntu-latest
389313 steps :
390314 - uses : actions/checkout@v6
@@ -419,10 +343,8 @@ jobs:
419343 incremental_files_only : true
420344
421345 miri :
422- if : ${{ !cancelled() && ! contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
346+ if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
423347 name : Run tests under miri
424- needs :
425- - auto_format_pr
426348 runs-on : ubuntu-latest
427349 timeout-minutes : 30
428350 env :
@@ -445,10 +367,8 @@ jobs:
445367 MIRIFLAGS : ' -Zmiri-ignore-leaks'
446368
447369 wasm :
448- if : ${{ !cancelled() && ! contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
370+ if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
449371 name : Check the WASM package and demo
450- needs :
451- - auto_format_pr
452372 runs-on : ubuntu-latest
453373 timeout-minutes : 30
454374 steps :
@@ -510,10 +430,8 @@ jobs:
510430 PUBLISH_BRANCH : master
511431
512432 wasm-wasi :
513- if : ${{ !cancelled() && ! contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
433+ if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
514434 name : Run snippets and cpython tests on wasm-wasi
515- needs :
516- - auto_format_pr
517435 runs-on : ubuntu-latest
518436 timeout-minutes : 30
519437 steps :
0 commit comments