feat: wcc module

This commit is contained in:
msojocs 2024-07-07 10:08:33 +08:00
parent e95371e22f
commit a3b858e143
8 changed files with 51 additions and 25 deletions

View File

@ -151,6 +151,8 @@ jobs:
# ./test/wine/wcc.exe
pnpm run test-prepare
sudo apt install -y xvfb
ls -l build
ls -l test/runner/nwjs/wcc/build/Release
# pnpm run test
- uses: ./.github/actions/test
with:

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
build
/build
cache
test/*.json
wcc.exe.c

1
test/node-gyp/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build

View File

@ -30,7 +30,9 @@ fi
rm -rf "$root_dir/cache/nwjs-sdk-v$nw_version-win-x64/package.nw"
cp -r "$cur_dir/package.nw" "$root_dir/cache/nwjs-sdk-v$nw_version-win-x64"
docker run -d -i\
docker_start(){
docker run -d -i\
--rm\
--volume=$root_dir:/workspace\
--env=USE_XVFB=yes\
--env=XVFB_SERVER=:95\
@ -46,8 +48,9 @@ docker run -d -i\
-p 8083:8083\
scottyhardy/docker-wine:latest\
wine /workspace/cache/nwjs-sdk-v$nw_version-win-x64/nw.exe
i=0
until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:8083/check); do
i=0
until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:8083/check); do
printf '.'
curl http://127.0.0.1:8083/check
sleep 1
@ -56,7 +59,25 @@ until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:8083/che
echo "error"
docker ps -a
docker logs wine
return 1
fi
done
return 0
}
for ((i=0; i<5; i++));
do
ret=$(docker_start)
if [ "$ret" -eq 0 ];then
echo "Docker started successfully."
break
fi
if [ "$i" -eq 4 ];then
echo "Failed to start Docker after 5 attempts."
docker ps -a
docker logs wine
exit 1
fi
sleep 1
done
echo "success"

Binary file not shown.

View File

@ -0,0 +1 @@
../../../../../../build/wcc_module.node

View File

@ -0,0 +1 @@
../../../../../../build/wcsc_module.node