Skip to content

Commit

Permalink
Workflow: cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokesh-Carbonix committed Oct 3, 2023
1 parent 60d29e3 commit 3532be9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/cygwin_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: 'windows-latest'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install cygwin
Expand All @@ -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
Expand Down
29 changes: 26 additions & 3 deletions Tools/scripts/cygwin_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,51 @@

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
python ./waf rover 2>&1
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
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/

0 comments on commit 3532be9

Please sign in to comment.