From 3532be9eb53f705ea05d384ff248811bd9dd5213 Mon Sep 17 00:00:00 2001 From: Lokesh-Carbonix Date: Mon, 2 Oct 2023 18:21:00 -0700 Subject: [PATCH] Workflow: cygwin --- .github/workflows/cygwin_build.yml | 11 ++++++++--- Tools/scripts/cygwin_build.sh | 29 ++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cygwin_build.yml b/.github/workflows/cygwin_build.yml index d737fa6297..d0e7e68c6f 100644 --- a/.github/workflows/cygwin_build.yml +++ b/.github/workflows/cygwin_build.yml @@ -10,7 +10,7 @@ jobs: runs-on: 'windows-latest' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: 'recursive' - name: Install cygwin @@ -26,9 +26,14 @@ jobs: HOME: ${{ runner.workspace }}/ardupilot run: | C:\Cygwin\bin\bash --login -c "Tools/scripts/cygwin_build.sh" - + - name: Check build files + id: check_files + uses: andstor/file-existence-action@v2 + with: + files: "artifacts/*" + fail: true - name: Archive build - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: binaries path: artifacts diff --git a/Tools/scripts/cygwin_build.sh b/Tools/scripts/cygwin_build.sh index 55e8bf6f9d..7761bd5ae3 100755 --- a/Tools/scripts/cygwin_build.sh +++ b/Tools/scripts/cygwin_build.sh @@ -8,13 +8,22 @@ set -x +# TOOLCHAIN=i686-pc-cygwin +TOOLCHAIN=x86_64-pc-cygwin +GPP_COMPILER="${TOOLCHAIN}-g++" + +$GPP_COMPILER -print-sysroot + +SYS_ROOT=$($GPP_COMPILER -print-sysroot) +echo "SYS_ROOT=$SYS_ROOT" + git config --global --add safe.directory /cygdrive/d/a/ardupilot/ardupilot rm -rf artifacts mkdir artifacts ( - python ./waf --color yes --toolchain i686-pc-cygwin --board sitl configure 2>&1 + python ./waf --color yes --toolchain $TOOLCHAIN --board sitl configure 2>&1 python ./waf plane 2>&1 python ./waf copter 2>&1 python ./waf heli 2>&1 @@ -22,7 +31,13 @@ mkdir artifacts python ./waf sub 2>&1 ) | tee artifacts/build.txt -i686-pc-cygwin-g++ -print-sysroot +# copy both with exe and without to cope with differences +# between windows versions in CI +cp -v build/sitl/bin/arduplane artifacts/ArduPlane.elf.exe +cp -v build/sitl/bin/arducopter artifacts/ArduCopter.elf.exe +cp -v build/sitl/bin/arducopter-heli artifacts/ArduHeli.elf.exe +cp -v build/sitl/bin/ardurover artifacts/ArduRover.elf.exe +cp -v build/sitl/bin/ardusub artifacts/ArduSub.elf.exe cp -v build/sitl/bin/arduplane artifacts/ArduPlane.elf cp -v build/sitl/bin/arducopter artifacts/ArduCopter.elf @@ -30,6 +45,14 @@ cp -v build/sitl/bin/arducopter-heli artifacts/ArduHeli.elf cp -v build/sitl/bin/ardurover artifacts/ArduRover.elf cp -v build/sitl/bin/ardusub artifacts/ArduSub.elf -cp -v /usr/i686-pc-cygwin/sys-root/usr/bin/*.dll artifacts/ +# Find all cyg*.dll files returned by cygcheck for each exe in artifacts +# and copy them over +for exe in artifacts/*.exe; do + echo $exe + cygcheck $exe | grep -oP 'cyg[^\s\\/]+\.dll' | while read -r line; do + cp -v /usr/bin/$line artifacts/ + done +done git log -1 > artifacts/git.txt +ls -l artifacts/