8000 chore(ci): use windows self hosted (#10579) · web-infra-dev/rspack@7bc5051 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7bc5051

Browse files
authored
chore(ci): use windows self hosted (#10579)
* perf: try no cache on windows * feat: specifier test runner lables by test-runner input
1 parent c927905 commit 7bc5051

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

.github/actions/rustup/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ runs:
3737
3838
- name: Restore rustup cache
3939
id: restore
40+
if: ${{ inputs.save-if == 'true' }}
4041
uses: ./.github/actions/cache/restore
4142
with:
4243
path: ~/.rustup/toolchains
@@ -63,7 +64,8 @@ runs:
6364
key: rustup-cache-v2-${{ runner.os }}-${{ steps.get-toolchain.outputs.toolchain }}
6465

6566
- name: Cargo cache
67+
if: ${{ runner.environment != 'self-hosted' || runner.os != 'Windows' }}
6668
uses: ./.github/actions/rustup/cargo
6769
with:
6870
key: ${{ inputs.key }}
69-
save-if: ${{ inputs.save-if }}
71+
save-if: ${{ inputs.save-if == 'true' }}

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ jobs:
6969
with:
7070
target: x86_64-pc-windows-msvc
7171
profile: "dev"
72-
runner: ${{ vars.WINDOWS_RUNNER_LABELS || '"windows-latest"' }}
72+
runner: ${{ vars.WINDOWS_SELF_HOSTED_RUNNER_LABELS || '"windows-latest"' }}
73+
test-runner: '"windows-latest"'
7374
test: true
7475

7576
test-mac:

.github/workflows/reusable-build-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ jobs:
4949
uses: ./.github/actions/rustup
5050
with:
5151
key: ${{ inputs.target }}-${{ inputs.profile }}
52-
save-if: true
52+
# don't need use cache in self-hosted windows; benefits of build with cargo build are wasted by cache restore
53+
save-if: ${{ runner.environment != 'self-hosted' || runner.os != 'Windows' }}
5354

5455
# setup rust target for native runner
5556
- name: Setup Rust Target

.github/workflows/reusable-build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
runner: # Runner labels
1010
required: true
1111
type: string
12+
test-runner: # Test Runner labels
13+
required: false
14+
type: string
1215
profile: # Rust profile, "ci" or "production" or "profiling"
1316
default: "ci"
1417
required: false
@@ -43,7 +46,7 @@ jobs:
4346
uses: ./.github/workflows/reusable-build-test.yml
4447
with:
4548
target: ${{ inputs.target }}
46-
runner: ${{ inputs.runner }}
49+
runner: ${{ inputs.test-runner || inputs.runner }}
4750
ref: ${{ inputs.ref }}
4851
bench:
4952
uses: ./.github/workflows/reusable-build-bench.yml

0 commit comments

Comments
 (0)
0