mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
76 lines
2.4 KiB
YAML
76 lines
2.4 KiB
YAML
name: macOS
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
MacOS:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
fetch-depth: 2
|
|
- name: Checkout submodules
|
|
run: |
|
|
git submodule update --init --recursive
|
|
- name: Install dependencies
|
|
run: |
|
|
brew install wget SDL2 premake
|
|
- name: Build
|
|
run: |
|
|
premake5 --disable-static-build --with-debug-symbols gmake
|
|
make -C make/macosx/ -j$(sysctl -n hw.ncpu) -e config=release_arm64
|
|
- name: Unit Tests
|
|
run: |
|
|
set +e
|
|
cd bin/unit_tests
|
|
mkdir -p output
|
|
crash_report_marker="$PWD/output/.unit-test-started"
|
|
touch "$crash_report_marker"
|
|
./eepp-unit_tests
|
|
status=$?
|
|
if [ "$status" -ne 0 ]; then
|
|
echo "::group::macOS crash reports"
|
|
mkdir -p output/crash-reports
|
|
crash_report_list="output/crash-reports/reports.txt"
|
|
for attempt in 1 2 3 4 5; do
|
|
: > "$crash_report_list"
|
|
for dir in "$HOME/Library/Logs/DiagnosticReports" "/Library/Logs/DiagnosticReports"; do
|
|
if [ -d "$dir" ]; then
|
|
find "$dir" -maxdepth 1 \( -name 'eepp-unit_tests*.crash' -o -name 'eepp-unit_tests*.ips' \) \
|
|
-newer "$crash_report_marker" -print >> "$crash_report_list" 2>/dev/null || true
|
|
fi
|
|
done
|
|
if [ -s "$crash_report_list" ]; then
|
|
break
|
|
fi
|
|
sleep 2
|
|
done
|
|
if [ -s "$crash_report_list" ]; then
|
|
while IFS= read -r report; do
|
|
[ -n "$report" ] || continue
|
|
echo "$report"
|
|
cp "$report" output/crash-reports/ || true
|
|
cat "$report" || true
|
|
done < "$crash_report_list"
|
|
else
|
|
echo "No eepp-unit_tests crash report found in DiagnosticReports."
|
|
fi
|
|
echo "::endgroup::"
|
|
echo "::group::lldb crash backtrace rerun"
|
|
lldb --batch \
|
|
-o "run" \
|
|
-k "thread backtrace all" \
|
|
-k "quit" \
|
|
-- ./eepp-unit_tests || true
|
|
echo "::endgroup::"
|
|
fi
|
|
exit "$status"
|
|
- name: Upload artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos-test-output
|
|
path: bin/unit_tests/output/*
|