Skip to content

Commit a67e069

Browse files
authored
More CI improvements (#20920)
1 parent 6a1e91c commit a67e069

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
1313
cancel-in-progress: true
1414

15+
defaults:
16+
run:
17+
shell: bash
18+
1519
env:
1620
CARGO_INCREMENTAL: 0
1721
CARGO_NET_RETRY: 10
1822
CARGO_TERM_COLOR: always
1923
RUSTUP_MAX_RETRIES: 10
2024
PACKAGE_NAME: ruff
2125
PYTHON_VERSION: "3.13"
26+
NEXTEST_PROFILE: ci
2227

2328
jobs:
2429
determine_changes:
@@ -271,9 +276,6 @@ jobs:
271276
# This step is just to get nice GitHub annotations on the PR diff in the files-changed tab.
272277
run: cargo test -p ty_python_semantic --test mdtest || true
273278
- name: "Run tests"
274-
shell: bash
275-
env:
276-
NEXTEST_PROFILE: "ci"
277279
run: cargo insta test --all-features --unreferenced reject --test-runner nextest
278280

279281
# Check for broken links in the documentation.
@@ -299,9 +301,13 @@ jobs:
299301

300302
cargo-test-linux-release:
301303
name: "cargo test (linux, release)"
302-
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
304+
# release builds timeout on GitHub runners, so this job is just skipped on forks in the `if` check
305+
runs-on: depot-ubuntu-22.04-16
303306
needs: determine_changes
304-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
307+
if: |
308+
github.repository == 'astral-sh/ruff' &&
309+
!contains(github.event.pull_request.labels.*.name, 'no-test') &&
310+
(needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main')
305311
timeout-minutes: 20
306312
steps:
307313
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -325,9 +331,6 @@ jobs:
325331
with:
326332
enable-cache: "true"
327333
- name: "Run tests"
328-
shell: bash
329-
env:
330-
NEXTEST_PROFILE: "ci"
331334
run: cargo insta test --release --all-features --unreferenced reject --test-runner nextest
332335

333336
cargo-test-windows:
@@ -352,9 +355,7 @@ jobs:
352355
with:
353356
enable-cache: "true"
354357
- name: "Run tests"
355-
shell: bash
356358
env:
357-
NEXTEST_PROFILE: "ci"
358359
# Workaround for <https://github.com/nextest-rs/nextest/issues/1493>.
359360
RUSTUP_WINDOWS_PATH_ADD_BIN: 1
360361
run: |
@@ -385,9 +386,6 @@ jobs:
385386
with:
386387
enable-cache: "true"
387388
- name: "Run tests"
388-
shell: bash
389-
env:
390-
NEXTEST_PROFILE: "ci"
391389
run: |
392390
cargo nextest run --all-features --profile ci
393391
cargo test --all-features --doc
@@ -445,7 +443,6 @@ jobs:
445443
- name: "Install mold"
446444
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
447445
- name: "Build tests"
448-
shell: bash
449446
env:
450447
MSRV: ${{ steps.msrv.outputs.value }}
451448
run: cargo "+${MSRV}" test --no-run --all-features

.github/workflows/mypy_primer.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ concurrency:
1919
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
2020
cancel-in-progress: true
2121

22+
defaults:
23+
run:
24+
shell: bash
25+
2226
env:
2327
CARGO_INCREMENTAL: 0
2428
CARGO_NET_RETRY: 10
@@ -49,7 +53,6 @@ jobs:
4953
run: rustup show
5054

5155
- name: Run mypy_primer
52-
shell: bash
5356
env:
5457
PRIMER_SELECTOR: crates/ty_python_semantic/resources/primer/good.txt
5558
DIFF_FILE: mypy_primer.diff
@@ -92,7 +95,6 @@ jobs:
9295
run: rustup show
9396

9497
- name: Run mypy_primer
95-
shell: bash
9698
env:
9799
TY_MAX_PARALLELISM: 1 # for deterministic memory numbers
98100
TY_MEMORY_REPORT: mypy_primer

.github/workflows/sync_typeshed.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,18 @@ on:
2828
# Run on the 1st and the 15th of every month:
2929
- cron: "0 0 1,15 * *"
3030

31+
defaults:
32+
run:
33+
shell: bash
34+
3135
env:
3236
# Don't set this flag globally for the workflow: it does strange things
3337
# to the snapshots in the `cargo insta test --accept` step in the MacOS job.
3438
#
3539
# FORCE_COLOR: 1
3640

3741
CARGO_TERM_COLOR: always
42+
NEXTEST_PROFILE: "ci"
3843
GH_TOKEN: ${{ github.token }}
3944

4045
# The name of the upstream branch that the first worker creates,
@@ -133,7 +138,6 @@ jobs:
133138
git config --global user.email '<>'
134139
- name: Sync Windows docstrings
135140
id: docstrings
136-
shell: bash
137141
env:
138142
FORCE_COLOR: 1
139143
run: ./scripts/codemod_docstrings.sh

0 commit comments

Comments
 (0)