Skip to content

Commit 860fa18

Browse files
committed
ci: fix in windows/freeBSD environment
1 parent 111aa01 commit 860fa18

File tree

1 file changed

+39
-38
lines changed

1 file changed

+39
-38
lines changed

.github/workflows/CI.yml

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ jobs:
116116
.\rustup-init.exe -y --default-toolchain stable --default-host ${{ matrix.settings.target }}
117117
echo "%USERPROFILE%\.cargo\bin" >> $env:GITHUB_PATH
118118
"%USERPROFILE%\.cargo\bin\rustup.exe" component add rustfmt clippy
119+
echo "CARGO_PATH=%USERPROFILE%\.cargo\bin" >> $env:GITHUB_ENV
119120
shell: cmd
120121

121122
- name: Install Rust (Non-Windows)
@@ -183,6 +184,15 @@ jobs:
183184
node-version: 22
184185
cache: pnpm
185186
architecture: x86
187+
- name: Verify Rust Installation (Windows)
188+
if: ${{ contains(matrix.settings.host, 'windows') }}
189+
run: |
190+
echo "PATH: %PATH%"
191+
echo "CARGO_PATH: %CARGO_PATH%"
192+
"%USERPROFILE%\.cargo\bin\cargo.exe" --version
193+
"%USERPROFILE%\.cargo\bin\rustc.exe" --version
194+
shell: cmd
195+
186196
- name: Build (Windows)
187197
if: ${{ contains(matrix.settings.host, 'windows') }}
188198
run: ${{ matrix.settings.build }}
@@ -212,44 +222,35 @@ jobs:
212222
name: Build FreeBSD
213223
steps:
214224
- uses: actions/checkout@v5
215-
- name: Build
216-
id: build
217-
uses: cross-platform-actions/action@v0.29.0
218-
env:
219-
DEBUG: napi:*
220-
RUSTUP_IO_THREADS: 1
221-
with:
222-
operating_system: freebsd
223-
version: '13.4'
224-
memory: 2G
225-
cpu_count: 1
226-
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
227-
shell: bash
228-
sync_files: false
229-
shutdown_vm: true
230-
run: |
231-
sudo pkg install -y -f curl node libnghttp2 npm
232-
sudo npm install -g corepack
233-
curl https://sh.rustup.rs -sSf --output rustup.sh
234-
sh rustup.sh -y --profile minimal --default-toolchain stable
235-
corepack prepare
236-
corepack enable
237-
source "$HOME/.cargo/env"
238-
echo "~~~~ rustc --version ~~~~"
239-
rustc --version
240-
echo "~~~~ node -v ~~~~"
241-
node -v
242-
echo "~~~~ pnpm --version ~~~~"
243-
pnpm --version
244-
pwd
245-
ls -lah
246-
whoami
247-
env
248-
freebsd-version
249-
pnpm install
250-
pnpm build
251-
rm -rf node_modules
252-
rm -rf target
225+
- name: Build FreeBSD with Docker
226+
run: |
227+
docker run --rm \
228+
-v $PWD:/workspace \
229+
-w /workspace \
230+
--memory=2g \
231+
--cpus=1 \
232+
freebsd:13.4 \
233+
bash -c "
234+
pkg install -y node npm curl
235+
npm install -g pnpm
236+
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
237+
source ~/.cargo/env
238+
echo '~~~~ rustc --version ~~~~'
239+
rustc --version
240+
echo '~~~~ node -v ~~~~'
241+
node -v
242+
echo '~~~~ pnpm --version ~~~~'
243+
pnpm --version
244+
pwd
245+
ls -lah
246+
whoami
247+
env
248+
freebsd-version
249+
pnpm install
250+
pnpm build
251+
rm -rf node_modules
252+
rm -rf target
253+
"
253254
- name: Upload artifact
254255
uses: actions/upload-artifact@v4
255256
with:

0 commit comments

Comments
 (0)