mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
- ci: copy libstdc++-6/libgcc_s_seh-1/libwinpthread-1 next to the built binaries so the tests can load libagent.dll; without them every test failed with a load error on the runner - tests: run-tests.ps1 now prints a failing test's captured output, so a failure is diagnosable even though the test program exits 0
61 lines
1.6 KiB
YAML
61 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-test:
|
|
name: Build & integration tests (Windows, MinGW)
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: '25'
|
|
|
|
- name: Set up MinGW-w64 toolchain
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: MINGW64
|
|
update: false
|
|
install: >-
|
|
mingw-w64-x86_64-gcc
|
|
mingw-w64-x86_64-cmake
|
|
mingw-w64-x86_64-ninja
|
|
|
|
- name: Configure
|
|
shell: msys2 {0}
|
|
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
|
|
|
|
- name: Build
|
|
shell: msys2 {0}
|
|
run: |
|
|
cmake --build build
|
|
|
|
# Bundle the MinGW runtime DLLs next to the binaries. The integration
|
|
# tests load libagent.dll through System.load, and its dependencies
|
|
# (libstdc++/libgcc/libwinpthread) are otherwise only found via PATH.
|
|
# copy-bin.bat then carries them into tests/resources as well.
|
|
for dll in libstdc++-6.dll libgcc_s_seh-1.dll libwinpthread-1.dll; do
|
|
if [ -f "/mingw64/bin/$dll" ]; then
|
|
cp -f "/mingw64/bin/$dll" build/bin/
|
|
fi
|
|
done
|
|
echo "--- build/bin ---"
|
|
ls -1 build/bin
|
|
|
|
- name: Run integration tests
|
|
shell: pwsh
|
|
run: |
|
|
# Prepend the toolchain bin as a fallback for the runtime DLLs.
|
|
$env:PATH = "C:\msys64\mingw64\bin;$env:PATH"
|
|
./tests/run-tests.ps1
|