Skip to content

Commit 5c3be4e

Browse files
committed
Merge remote-tracking branch 'origin' into feat/loaders-execution-on-browser
2 parents 6e578d4 + 66274ca commit 5c3be4e

File tree

38 files changed

+18010
-11397
lines changed

38 files changed

+18010
-11397
lines changed

.github/workflows/pm-ci.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,48 +31,86 @@ jobs:
3131
test: |
3232
cargo test -p utoo-pm --target aarch64-unknown-linux-gnu -- --nocapture
3333
34+
- host: windows-latest
35+
target: x86_64-pc-windows-msvc
36+
test: |
37+
cargo test -p utoo-pm --target x86_64-pc-windows-msvc -- --nocapture
38+
3439
name: utoopm-ci-${{ matrix.settings.target }}
3540
runs-on: ${{ matrix.settings.host }}
3641
steps:
3742
- uses: actions/checkout@v4
3843
with:
3944
submodules: false
45+
4046
- name: Add SSH private keys for submodule repositories
4147
uses: webfactory/ssh-agent@v0.7.0
4248
with:
4349
ssh-private-key: |
4450
${{ secrets.CI_SUBMODULE }}
51+
4552
- name: Init git submodules
4653
run: git submodule update --init --depth 1
54+
55+
# Add: Configure Git longpaths on Windows
56+
- name: Configure Git (Windows)
57+
if: runner.os == 'Windows'
58+
run: git config --system core.longpaths true
59+
60+
# Add: Install OpenSSL on Windows
61+
- name: Install OpenSSL (Windows)
62+
if: runner.os == 'Windows'
63+
shell: powershell
64+
run: |
65+
Write-Host "Installing OpenSSL via vcpkg..."
66+
vcpkg install openssl:x64-windows-static-md
67+
68+
$openssl_dir = "C:\vcpkg\installed\x64-windows-static-md"
69+
echo "OPENSSL_DIR=$openssl_dir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
70+
echo "OPENSSL_NO_VENDOR=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
71+
echo "OPENSSL_STATIC=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
72+
73+
Write-Host "OpenSSL installed at: $openssl_dir"
74+
if (Test-Path "$openssl_dir\lib") {
75+
Get-ChildItem "$openssl_dir\lib" -Filter "*.lib" | Select-Object Name | Format-Table
76+
}
77+
4778
- name: Setup node
4879
uses: actions/setup-node@v4
4980
if: ${{ !matrix.settings.docker }}
5081
with:
5182
node-version: 20
52-
- name: Install
83+
84+
- name: Install Rust
5385
uses: dtolnay/rust-toolchain@stable
5486
if: ${{ !matrix.settings.docker }}
5587
with:
5688
toolchain: nightly-2025-10-27
5789
targets: ${{ matrix.settings.target }}
90+
5891
- name: Cache cargo
5992
uses: Swatinem/rust-cache@v2
93+
6094
- name: Setup toolchain
6195
run: ${{ matrix.settings.setup }}
6296
if: ${{ matrix.settings.setup }}
6397
shell: bash
98+
6499
- name: Install dependencies
65100
run: npm install
101+
66102
- name: Setup node x86
67103
uses: actions/setup-node@v4
104+
68105
- name: Test in docker
69106
uses: addnab/docker-run-action@v3
70107
if: ${{ matrix.settings.docker }}
71108
with:
72109
image: ${{ matrix.settings.docker }}
73110
options: "-v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build"
74111
run: ${{ matrix.settings.test }}
112+
75113
- name: Test
76114
run: ${{ matrix.settings.test }}
77115
if: ${{ !matrix.settings.docker }}
78-
shell: bash
116+
shell: bash

.github/workflows/pm-e2e.yml

Lines changed: 79 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
target: x86_64-apple-darwin
1919
- host: ubuntu-latest
2020
target: x86_64-unknown-linux-gnu
21+
- host: windows-latest
22+
target: x86_64-pc-windows-msvc
2123

2224
name: utoopm-e2e-${{ matrix.settings.target }}
2325
runs-on: ${{ matrix.settings.host }}
@@ -46,7 +48,8 @@ jobs:
4648
nvm use 22
4749
nvm alias default 22
4850
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
49-
echo "$HOME/.nvm/versions/node/v22.*/bin" >> $GITHUB_PATH
51+
NODE_PATH=$(find $HOME/.nvm/versions/node -name "v22.*" -type d | head -1)
52+
echo "$NODE_PATH/bin" >> $GITHUB_PATH
5053
node -p process.arch
5154
npm -v
5255
'
@@ -66,36 +69,97 @@ jobs:
6669
- name: Cache cargo
6770
uses: Swatinem/rust-cache@v2
6871

69-
# - name: Cache nm cache
70-
# uses: actions/cache@v4
71-
# with:
72-
# path: ~/.cache/nm
73-
# key: e2e-nm-cache
74-
# restore-keys: |
75-
# e2e-nm-cache
76-
7772
- name: Build utoo-pm
78-
run: cargo build --release --target ${{ matrix.settings.target }} --bin utoo
73+
run: cargo build --release --target ${{ matrix.settings.target }} --bin utoo -p utoo-pm
7974

80-
- name: Update PATH with target directory
75+
- name: Update PATH (Unix)
76+
if: matrix.settings.host != 'windows-latest'
8177
run: echo "${{ github.workspace }}/target/${{ matrix.settings.target }}/release" >> $GITHUB_PATH
8278

83-
- name: Create ut symlink for utoo
79+
- name: Update PATH (Windows)
80+
if: matrix.settings.host == 'windows-latest'
81+
shell: pwsh
82+
run: |
83+
$binPath = "${{ github.workspace }}\target\${{ matrix.settings.target }}\release"
84+
echo $binPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
85+
Write-Host "Added to PATH: $binPath"
86+
87+
- name: Create ut symlink for utoo (Unix)
88+
if: matrix.settings.host != 'windows-latest'
8489
run: ln -sf utoo $(dirname $(which utoo))/ut
8590

91+
- name: Create ut copy for utoo (Windows)
92+
if: matrix.settings.host == 'windows-latest'
93+
shell: pwsh
94+
run: |
95+
$binPath = "${{ github.workspace }}\target\${{ matrix.settings.target }}\release"
96+
$utooPath = Join-Path $binPath "utoo.exe"
97+
$utPath = Join-Path $binPath "ut.exe"
98+
99+
if (Test-Path $utooPath) {
100+
Copy-Item $utooPath $utPath -Force
101+
Write-Host "Created ut.exe at: $utPath"
102+
} else {
103+
Write-Error "utoo.exe not found at: $utooPath"
104+
exit 1
105+
}
106+
107+
- name: Verify tools (Unix)
108+
if: matrix.settings.host != 'windows-latest'
109+
run: |
110+
echo "utoo: $(which utoo)"
111+
echo "ut: $(which ut)"
112+
utoo --version
113+
ut --version
114+
115+
- name: Verify tools (Windows)
116+
if: matrix.settings.host == 'windows-latest'
117+
shell: pwsh
118+
run: |
119+
$binPath = "${{ github.workspace }}\target\${{ matrix.settings.target }}\release"
120+
Write-Host "Binary path: $binPath"
121+
Write-Host "utoo.exe: $(Test-Path "$binPath\utoo.exe")"
122+
Write-Host "ut.exe: $(Test-Path "$binPath\ut.exe")"
123+
124+
# Add to current session PATH
125+
$env:PATH = "$binPath;$env:PATH"
126+
127+
# Verify commands
128+
Get-Command utoo | Select-Object -ExpandProperty Source
129+
Get-Command ut | Select-Object -ExpandProperty Source
130+
utoo --version
131+
ut --version
132+
86133
- name: Make script executable
134+
if: matrix.settings.host != 'windows-latest'
87135
run: chmod +x e2e/utoo-pm.sh
88136

89-
- name: Run e2e tests
137+
- name: Run e2e tests (Unix)
138+
if: matrix.settings.host != 'windows-latest'
90139
run: |
91140
if [ "${{ matrix.settings.target }}" = "x86_64-apple-darwin" ]; then
92141
arch -x86_64 bash -c '
93142
export NVM_DIR="$HOME/.nvm"
94143
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
95144
nvm use 22
96-
e2e/utoo-pm.sh
145+
bash e2e/utoo-pm.sh
97146
'
98147
else
99-
e2e/utoo-pm.sh
148+
bash e2e/utoo-pm.sh
100149
fi
101150
shell: bash
151+
152+
- name: Run e2e tests (Windows)
153+
if: matrix.settings.host == 'windows-latest'
154+
shell: pwsh
155+
run: |
156+
git config --system core.longpaths true
157+
158+
# Ensure binaries are in PATH
159+
$binPath = "${{ github.workspace }}\target\${{ matrix.settings.target }}\release"
160+
$env:PATH = "$binPath;$env:PATH"
161+
162+
Write-Host "Running e2e tests..."
163+
Write-Host "Working directory: $(Get-Location)"
164+
165+
pwsh -File e2e/utoo-pm.ps1 --verbose

.github/workflows/pm-release.yml

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ jobs:
3131
platform_os: linux
3232
platform_cpu: arm64
3333

34+
- os: windows-latest
35+
target: x86_64-pc-windows-msvc
36+
platform_os: win32
37+
platform_cpu: x64
38+
3439
runs-on: ${{ matrix.os }}
3540
container:
3641
image: ${{ matrix.container }}
@@ -114,12 +119,35 @@ jobs:
114119
command: build
115120
args: --release --bin utoo --target ${{ matrix.target }}
116121

117-
- name: Package Binaries
122+
- name: Package Binaries
123+
run: |
124+
cd target/${{ matrix.target }}/release
125+
if [ "${{ matrix.platform_os }}" = "win32" ]; then
126+
tar -czf ../../../utoo-${{ matrix.platform_os }}-${{ matrix.platform_cpu }}.tar.gz utoo.exe
127+
else
128+
tar -czf ../../../utoo-${{ matrix.platform_os }}-${{ matrix.platform_cpu }}.tar.gz utoo
129+
fi
130+
shell: bash
131+
132+
- name: Verify npm package (dry-run)
133+
env:
134+
VERSION: ${{ steps.get_version.outputs.VERSION }}
118135
run: |
119-
cd target/${{ matrix.target }}/release
120-
tar -czf ../../../utoo-${{ matrix.platform_os }}-${{ matrix.platform_cpu }}.tar.gz \
121-
utoo
122-
136+
cd vendor/scripts
137+
138+
BINS=("utoo")
139+
for BIN in "${BINS[@]}"; do
140+
PACKAGE_NAME="$BIN"
141+
142+
if [ "${{ matrix.platform_os }}" = "win32" ]; then
143+
BINARY_PATH="../../target/${{ matrix.target }}/release/${BIN}.exe"
144+
else
145+
BINARY_PATH="../../target/${{ matrix.target }}/release/${BIN}"
146+
fi
147+
148+
./npm-binary.sh "$PACKAGE_NAME" "$VERSION" "$BINARY_PATH" "${{ matrix.platform_os }}" "${{ matrix.platform_cpu }}"
149+
done
150+
123151
- name: Upload Release Asset
124152
env:
125153
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -142,12 +170,18 @@ jobs:
142170
run: |
143171
set -e
144172
cd vendor/scripts
173+
145174
BINS=("utoo")
146175
for BIN in "${BINS[@]}"; do
147-
PACKAGE_NAME=$(echo "$BIN")
148-
./npm-binary.sh "$PACKAGE_NAME" "$VERSION" \
149-
"../../target/${{ matrix.target }}/release/$BIN" \
150-
"${{ matrix.platform_os }}" "${{ matrix.platform_cpu }}"
176+
PACKAGE_NAME="$BIN"
177+
178+
if [ "${{ matrix.platform_os }}" = "win32" ]; then
179+
BINARY_PATH="../../target/${{ matrix.target }}/release/${BIN}.exe"
180+
else
181+
BINARY_PATH="../../target/${{ matrix.target }}/release/${BIN}"
182+
fi
183+
184+
./npm-binary.sh "$PACKAGE_NAME" "$VERSION" "$BINARY_PATH" "${{ matrix.platform_os }}" "${{ matrix.platform_cpu }}"
151185
done
152186
153187
publish-main:

.typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ extend-exclude = [
1010
"next.js/",
1111
"crates/pack-tests/tests/snapshot/**/output/",
1212
"crates/pack-core/js/src/node-polyfills",
13+
"e2e/pm/**",
1314
"packages/utoo-web/src/webpackLoaders/nodePolyFillRaw",
1415
"packages/utoo-web/src/webpackLoaders/workerContent.js"
1516
]

0 commit comments

Comments
 (0)