Skip to content

Build

Build #156

Workflow file for this run

name: Build
on:
pull_request:
branches:
- main
- dev
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
spm-tests:
name: SPM Package Tests
runs-on: macos-26
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Test MeshCore
run: |
swift test --package-path MeshCore &
TEST_PID=$!
(
sleep 600
echo "::warning::swift test still running after 10 minutes - sampling process tree"
for pid in $(pgrep -f "MeshCorePackageTests|swiftpm-testing-helper|swift-test" || true); do
echo "=== sample of PID $pid ==="
sample "$pid" 5 2>/dev/null || true
done
kill -9 $TEST_PID 2>/dev/null || true
) &
WATCHDOG=$!
if wait $TEST_PID; then
kill $WATCHDOG 2>/dev/null || true
else
STATUS=$?
kill $WATCHDOG 2>/dev/null || true
exit $STATUS
fi
- name: Test MC1Services
run: |
swift test --package-path MC1Services &
TEST_PID=$!
(
sleep 600
echo "::warning::swift test still running after 10 minutes - sampling process tree"
for pid in $(pgrep -f "MC1ServicesPackageTests|swiftpm-testing-helper|swift-test" || true); do
echo "=== sample of PID $pid ==="
sample "$pid" 5 2>/dev/null || true
done
kill -9 $TEST_PID 2>/dev/null || true
) &
WATCHDOG=$!
if wait $TEST_PID; then
kill $WATCHDOG 2>/dev/null || true
else
STATUS=$?
kill $WATCHDOG 2>/dev/null || true
exit $STATUS
fi
xcode-build:
name: Xcode Build
runs-on: macos-26
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install dependencies
run: |
command -v xcodegen >/dev/null 2>&1 || brew install xcodegen
command -v swiftgen >/dev/null 2>&1 || brew install swiftgen
- name: Generate Xcode project
run: xcodegen generate
- name: Cache Xcode build
uses: irgaly/xcode-cache@v1
with:
key: xcode-deriveddata-${{ github.workflow }}-${{ github.sha }}
restore-keys: |
xcode-deriveddata-${{ github.workflow }}-
deriveddata-directory: .derivedData
delete-used-deriveddata-cache: true
- name: Build
run: |
xcodebuild build \
-project MC1.xcodeproj \
-scheme MC1 \
-destination "generic/platform=iOS Simulator" \
-derivedDataPath .derivedData \
CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
COMPILER_INDEX_STORE_ENABLE=NO