Skip to content

Fix Windows CI compatibility and binary build issues #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ env:
jobs:
test-go:
name: Test Go
runs-on: rspack-ubuntu-22.04-large
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
[
rspack-ubuntu-22.04-large,
rspack-windows-2022-large,
rspack-darwin-14-medium,
]
go-version: ['1.24.1']
steps:
- name: Checkout code
Expand Down Expand Up @@ -53,9 +59,15 @@ jobs:

test-node:
name: Test npm packages
runs-on: rspack-ubuntu-22.04-large
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
[
rspack-ubuntu-22.04-large,
rspack-windows-2022-large,
rspack-darwin-14-medium,
]
go-version: ['1.24.1']
steps:
- name: Checkout code
Expand Down Expand Up @@ -87,8 +99,8 @@ jobs:
- name: TypeCheck
run: pnpm typecheck

- name: Install xvfb and dependencies
if: ${{ runner.os == 'Linux' && runner.environment == 'self-hosted' }}
- name: Install xvfb and dependencies (Linux only)
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt update
sudo apt install -y libasound2 libgbm1 libgtk-3-0 libnss3 xvfb
Expand All @@ -97,16 +109,16 @@ jobs:
uses: lynx-infra/cache@5c6160a6a4c7fca80a2f3057bb9dfc9513fcb732
with:
path: packages/vscode-extension/.vscode-test
key: 'vscode-test'
key: vscode-test-${{ matrix.os }}
restore-keys: |
- 'vscode-test-'
vscode-test-${{ matrix.os }}-

- name: Test on Linux
if: runner.os == 'Linux'
if: ${{ runner.os == 'Linux' }}
run: xvfb-run -a pnpm -r test

- name: Test on non-Linux
if: runner.os != 'Linux'
if: ${{ runner.os != 'Linux' }}
run: pnpm -r test

- name: Check Spell
Expand All @@ -120,7 +132,7 @@ jobs:
- test-go
- test-node
if: always()
runs-on: rspack-ubuntu-22.04-large
runs-on: ubuntu-latest
name: CI Done
steps:
- run: exit 1
Expand Down
3 changes: 2 additions & 1 deletion scripts/build-npm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ async function build_all() {
{ os: 'windows', arch: 'arm64', 'node-arch': 'arm64', 'node-os': 'win32' },
];
for (const platform of platforms) {
await $`GOOS=${platform.os} GOARCH=${platform.arch} go build -o npm/${platform['node-os'] || platform.os}-${platform['node-arch']}/rslint ./cmd/rslint`;
const binaryName = platform.os === 'windows' ? 'rslint.exe' : 'rslint';
await $`GOOS=${platform.os} GOARCH=${platform.arch} go build -o npm/${platform['node-os'] || platform.os}-${platform['node-arch']}/${binaryName} ./cmd/rslint`;
}
}
async function main() {
Expand Down
Loading