From 152791709b34a075cc710b334f79f8f043eb67ea Mon Sep 17 00:00:00 2001 From: Khalifa Nabil Date: Mon, 14 Sep 2026 18:40:56 +0700 Subject: [PATCH] ci(actions): add pull request CI workflow for macOS 14 and 15 - Run parallel unit test suites with swift test - Validate ./build.sh app bundle packaging and ad-hoc codesigning - Test on both macos-14 and macos-15 GitHub-hosted runners - Upload signed application and lidprobe artifacts on successful builds --- .github/workflows/ci.yml | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b1260e9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,83 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + test-and-build: + name: Build & Test (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-14, macos-15] + timeout-minutes: 30 + defaults: + run: + shell: bash + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Select Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Show toolchain + run: | + xcodebuild -version + swift --version + + - name: Run unit test suites + run: | + set -euo pipefail + if [ -z "${SDKROOT:-}" ] && [ -d "/Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk" ]; then + export SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk" + fi + swift test --parallel + + - name: Build application bundle and CLI tool + run: | + set -euo pipefail + ./build.sh + + - name: Validate build artifacts and codesigning + run: | + set -euo pipefail + echo "Verifying application bundle existence and structure..." + test -d "build/Mac Duo.app" + test -f "build/Mac Duo.app/Contents/MacOS/MacDuo" + test -x "build/Mac Duo.app/Contents/MacOS/MacDuo" + test -f "build/Mac Duo.app/Contents/Info.plist" + test -d "build/Mac Duo.app/Contents/Resources" + + echo "Verifying lidprobe CLI diagnostic tool..." + test -f "build/lidprobe" + test -x "build/lidprobe" + + echo "Verifying ad-hoc code signature of Mac Duo.app..." + codesign --verify --strict --verbose=2 "build/Mac Duo.app" + codesign -dv "build/Mac Duo.app" + + echo "CI validation completed successfully." + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + if: success() + with: + name: Mac-Duo-${{ matrix.os }} + path: | + build/Mac Duo.app + build/lidprobe + retention-days: 14