Skip to content

Commit 256a910

Browse files
authored
ci: Move doctests to a separate parallel job (#38111)
Follow on from #37851 This may reduce CI time by running doctests in parallel with other tests. It also makes it easier to find the results. Example output: https://github.com/zed-industries/zed/actions/runs/17698218116/job/50300398669?pr=38111 At least on this run, the doctests finished before the main Linux tests, which makes sense because there are many fewer doctests. So they should not be on the critical path. Thanks @maxdeviant for the prompt. <img width="615" height="513" alt="image" src="https://github.com/user-attachments/assets/bcafa636-a68c-4602-97f4-61f7904e6a7b" /> Release Notes: - N/A
1 parent 85aa458 commit 256a910

File tree

2 files changed

+40
-5
lines changed

2 files changed

+40
-5
lines changed

.github/actions/run_tests/action.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,3 @@ runs:
2121
- name: Run tests
2222
shell: bash -euxo pipefail {0}
2323
run: cargo nextest run --workspace --no-fail-fast
24-
25-
- name: Run doctests
26-
shell: bash -euxo pipefail {0}
27-
# Nextest currently doesn't support doctests
28-
run: cargo test --workspace --doc --no-fail-fast

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,46 @@ jobs:
373373
if: always()
374374
run: rm -rf ./../.cargo
375375

376+
doctests:
377+
# Nextest currently doesn't support doctests, so run them separately and in parallel.
378+
timeout-minutes: 60
379+
name: (Linux) Run doctests
380+
needs: [job_spec]
381+
if: |
382+
github.repository_owner == 'zed-industries' &&
383+
needs.job_spec.outputs.run_tests == 'true'
384+
runs-on:
385+
- namespace-profile-16x32-ubuntu-2204
386+
steps:
387+
- name: Add Rust to the PATH
388+
run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
389+
390+
- name: Checkout repo
391+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
392+
with:
393+
clean: false
394+
395+
- name: Cache dependencies
396+
uses: swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2
397+
with:
398+
save-if: ${{ github.ref == 'refs/heads/main' }}
399+
# cache-provider: "buildjet"
400+
401+
- name: Install Linux dependencies
402+
run: ./script/linux
403+
404+
- name: Configure CI
405+
run: |
406+
mkdir -p ./../.cargo
407+
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
408+
409+
- name: Run doctests
410+
run: cargo test --workspace --doc --no-fail-fast
411+
412+
- name: Clean CI config file
413+
if: always()
414+
run: rm -rf ./../.cargo
415+
376416
build_remote_server:
377417
timeout-minutes: 60
378418
name: (Linux) Build Remote Server

0 commit comments

Comments
 (0)