Skip to content

Commit cbc7596

Browse files
committed
chore: try fix windows
1 parent 4cd54a4 commit cbc7596

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/actions/setup-go/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ runs:
2121

2222
- name: Clean Go module cache dir
2323
shell: bash
24+
if: runner.os == 'linux'
2425
run: sudo rm -rf ~/go/pkg/mod/golang.org/toolchain*
2526

2627
- name: Go cache

.github/workflows/ci.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ env:
1919
jobs:
2020
test-go:
2121
name: Test Go
22-
runs-on: rspack-ubuntu-22.04-large
22+
runs-on: ${{ matrix.runner }}
2323
strategy:
2424
matrix:
25+
runner: [rspack-ubuntu-22.04-large, windows-latest]
2526
go-version: ['1.24.1']
2627
steps:
2728
- name: Checkout code
@@ -39,23 +40,27 @@ jobs:
3940
go-version: ${{ matrix.go-version }}
4041
cache-name: test-go
4142
- name: golangci-lint
43+
if: runner.os != 'Linux'
4244
uses: golangci/golangci-lint-action@v8
4345
with:
4446
version: v2.3.0
4547
args: --timeout=5m ./cmd/... ./internal/...
4648
- name: go vet
49+
if: runner.os != 'Linux'
4750
run: npm run lint:go
4851
- name: go fmt
52+
if: runner.os != 'Linux'
4953
run: npm run format:go
5054
- name: Unit Test
5155
run: |
5256
go test -parallel 4 ./internal/...
5357
5458
test-node:
5559
name: Test npm packages
56-
runs-on: rspack-ubuntu-22.04-large
60+
runs-on: ${{ matrix.os }}
5761
strategy:
5862
matrix:
63+
os: [rspack-ubuntu-22.04-large, windows-latest]
5964
go-version: ['1.24.1']
6065
steps:
6166
- name: Checkout code
@@ -73,16 +78,18 @@ jobs:
7378
uses: ./.github/actions/setup-node
7479

7580
- name: Format
81+
if: runner.os == 'Linux'
7682
run: pnpm format:check
7783

7884
- name: Build
7985
run: pnpm build
8086

8187
- name: TypeCheck
88+
if: runner.os == 'Linux'
8289
run: pnpm typecheck
8390

84-
- name: Install xvfb and dependencies
85-
if: ${{ runner.os == 'Linux' && runner.environment == 'self-hosted' }}
91+
- name: Install xvfb and dependencies (Linux only)
92+
if: runner.os == 'Linux'
8693
run: |
8794
sudo apt update
8895
sudo apt install -y libasound2 libgbm1 libgtk-3-0 libnss3 xvfb
@@ -91,9 +98,9 @@ jobs:
9198
uses: lynx-infra/cache@5c6160a6a4c7fca80a2f3057bb9dfc9513fcb732
9299
with:
93100
path: packages/vscode-extension/.vscode-test
94-
key: 'vscode-test'
101+
key: vscode-test-${{ matrix.os }}
95102
restore-keys: |
96-
- 'vscode-test-'
103+
vscode-test-${{ matrix.os }}-
97104
98105
- name: Test on Linux
99106
if: runner.os == 'Linux'
@@ -104,17 +111,19 @@ jobs:
104111
run: pnpm -r test
105112

106113
- name: Check Spell
114+
if: runner.os != 'Linux'
107115
run: pnpm check-spell
108116

109117
- name: Lint
118+
if: runner.os != 'Linux'
110119
run: pnpm run lint
111120

112121
done:
113122
needs:
114123
- test-go
115124
- test-node
116125
if: always()
117-
runs-on: rspack-ubuntu-22.04-large
126+
runs-on: ubuntu-latest
118127
name: CI Done
119128
steps:
120129
- run: exit 1

0 commit comments

Comments
 (0)