Skip to content

Commit 3db5d59

Browse files
authored
Don't use codspeed or depot runners in CI jobs on forks (#20894)
1 parent d23826c commit 3db5d59

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ jobs:
237237

238238
cargo-test-linux:
239239
name: "cargo test (linux)"
240-
runs-on: depot-ubuntu-22.04-16
240+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
241241
needs: determine_changes
242242
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
243243
timeout-minutes: 20
@@ -299,7 +299,7 @@ jobs:
299299

300300
cargo-test-linux-release:
301301
name: "cargo test (linux, release)"
302-
runs-on: depot-ubuntu-22.04-16
302+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
303303
needs: determine_changes
304304
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
305305
timeout-minutes: 20
@@ -332,7 +332,7 @@ jobs:
332332

333333
cargo-test-windows:
334334
name: "cargo test (windows)"
335-
runs-on: depot-windows-2022-16
335+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-windows-2022-16' || 'windows-latest' }}
336336
needs: determine_changes
337337
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
338338
timeout-minutes: 20
@@ -424,7 +424,7 @@ jobs:
424424
425425
cargo-build-msrv:
426426
name: "cargo build (msrv)"
427-
runs-on: depot-ubuntu-latest-8
427+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-latest-8' || 'ubuntu-latest' }}
428428
needs: determine_changes
429429
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
430430
timeout-minutes: 20
@@ -538,7 +538,7 @@ jobs:
538538

539539
ecosystem:
540540
name: "ecosystem"
541-
runs-on: depot-ubuntu-latest-8
541+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-latest-8' || 'ubuntu-latest' }}
542542
needs:
543543
- cargo-test-linux
544544
- determine_changes
@@ -663,7 +663,7 @@ jobs:
663663

664664
fuzz-ty:
665665
name: "Fuzz for new ty panics"
666-
runs-on: depot-ubuntu-22.04-16
666+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
667667
needs:
668668
- cargo-test-linux
669669
- determine_changes
@@ -723,7 +723,7 @@ jobs:
723723

724724
ty-completion-evaluation:
725725
name: "ty completion evaluation"
726-
runs-on: depot-ubuntu-22.04-16
726+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
727727
needs: determine_changes
728728
if: ${{ needs.determine_changes.outputs.ty == 'true' || github.ref == 'refs/heads/main' }}
729729
steps:
@@ -769,7 +769,7 @@ jobs:
769769

770770
pre-commit:
771771
name: "pre-commit"
772-
runs-on: depot-ubuntu-22.04-16
772+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
773773
timeout-minutes: 10
774774
steps:
775775
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -943,8 +943,12 @@ jobs:
943943
runs-on: ubuntu-24.04
944944
needs: determine_changes
945945
if: |
946-
github.ref == 'refs/heads/main' ||
947-
(needs.determine_changes.outputs.formatter == 'true' || needs.determine_changes.outputs.linter == 'true')
946+
github.repository == 'astral-sh/ruff' &&
947+
(
948+
github.ref == 'refs/heads/main' ||
949+
needs.determine_changes.outputs.formatter == 'true' ||
950+
needs.determine_changes.outputs.linter == 'true'
951+
)
948952
timeout-minutes: 20
949953
steps:
950954
- name: "Checkout Branch"
@@ -978,8 +982,11 @@ jobs:
978982
runs-on: ubuntu-24.04
979983
needs: determine_changes
980984
if: |
981-
github.ref == 'refs/heads/main' ||
982-
needs.determine_changes.outputs.ty == 'true'
985+
github.repository == 'astral-sh/ruff' &&
986+
(
987+
github.ref == 'refs/heads/main' ||
988+
needs.determine_changes.outputs.ty == 'true'
989+
)
983990
timeout-minutes: 20
984991
steps:
985992
- name: "Checkout Branch"

.github/workflows/mypy_primer.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ env:
2929
jobs:
3030
mypy_primer:
3131
name: Run mypy_primer
32-
runs-on: depot-ubuntu-22.04-32
32+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-32' || 'ubuntu-latest' }}
3333
timeout-minutes: 20
3434
steps:
3535
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -72,7 +72,7 @@ jobs:
7272

7373
memory_usage:
7474
name: Run memory statistics
75-
runs-on: depot-ubuntu-22.04-32
75+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-32' || 'ubuntu-latest' }}
7676
timeout-minutes: 20
7777
steps:
7878
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

.github/workflows/ty-ecosystem-analyzer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
jobs:
2323
ty-ecosystem-analyzer:
2424
name: Compute diagnostic diff
25-
runs-on: depot-ubuntu-22.04-32
25+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-32' || 'ubuntu-latest' }}
2626
timeout-minutes: 20
2727
if: contains(github.event.label.name, 'ecosystem-analyzer')
2828
steps:

.github/workflows/ty-ecosystem-report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919
jobs:
2020
ty-ecosystem-report:
2121
name: Create ecosystem report
22-
runs-on: depot-ubuntu-22.04-32
22+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-32' || 'ubuntu-latest' }}
2323
timeout-minutes: 20
2424
steps:
2525
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

.github/workflows/typing_conformance.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ env:
2929
jobs:
3030
typing_conformance:
3131
name: Compute diagnostic diff
32-
runs-on: depot-ubuntu-22.04-32
32+
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-32' || 'ubuntu-latest' }}
3333
timeout-minutes: 10
3434
steps:
3535
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

0 commit comments

Comments
 (0)