Gitea Actions CI/CD Pipeline for Intel macOS Builds #25

Closed
opened 2026-09-08 10:29:52 +01:00 by gronod · 2 comments
Owner

Purpose

Automate the continuous integration and delivery lifecycle for MacMonitor using Gitea Actions runners, ensuring every commit and pull request compiles cleanly against macOS 14+ SDK for Intel x86_64 and passes automated test suites.

Priority

High (Guarantees build integrity, Intel x86_64 architecture verification, and regression prevention)

Dependencies

  • Depends on #1 (Core Application Architecture & Objective-C/SwiftUI Bridging Foundation)

Scope

  • Configure Gitea Actions workflow .gitea/workflows/build.yml.
  • Target self-hosted or managed macOS Intel runners.
  • Automate:
    • Xcode workspace / project compilation targeting x86_64
    • Execution of XCTest test suites (mocking hardware/SMC layers where appropriate)
    • SwiftLint / code style analysis
    • Archive generation (.app / .zip artifact upload) on tagged releases
  • Report build status back to Gitea commit statuses and pull requests.

Implementation Suggestions

  • Define workflow YAML with runs-on: [macos, intel] or matching Gitea runner tags.
  • Execute builds via command line:
    xcodebuild build test -scheme MacMonitor -destination 'generic/platform=macOS,arch=x86_64' CODE_SIGNING_ALLOWED=NO
  • Use Actions artifact upload steps to attach zipped .app bundles to Gitea release builds.
### Purpose Automate the continuous integration and delivery lifecycle for MacMonitor using Gitea Actions runners, ensuring every commit and pull request compiles cleanly against macOS 14+ SDK for Intel x86_64 and passes automated test suites. ### Priority **High** (Guarantees build integrity, Intel x86_64 architecture verification, and regression prevention) ### Dependencies - Depends on #1 (Core Application Architecture & Objective-C/SwiftUI Bridging Foundation) ### Scope - Configure Gitea Actions workflow `.gitea/workflows/build.yml`. - Target self-hosted or managed macOS Intel runners. - Automate: - Xcode workspace / project compilation targeting `x86_64` - Execution of XCTest test suites (mocking hardware/SMC layers where appropriate) - SwiftLint / code style analysis - Archive generation (`.app` / `.zip` artifact upload) on tagged releases - Report build status back to Gitea commit statuses and pull requests. ### Implementation Suggestions - Define workflow YAML with `runs-on: [macos, intel]` or matching Gitea runner tags. - Execute builds via command line: `xcodebuild build test -scheme MacMonitor -destination 'generic/platform=macOS,arch=x86_64' CODE_SIGNING_ALLOWED=NO` - Use Actions artifact upload steps to attach zipped `.app` bundles to Gitea release builds.
gronod added the Kind/Feature
Priority
High
2
Project/AntigravityFeature/DevOps
labels 2026-09-08 10:29:52 +01:00
Author
Owner

Technical Implementation Plan & Code Solution

1. Gitea Actions Architecture

The continuous integration pipeline automates building and verifying MacMonitor on self-hosted or managed macOS Intel runners.

flowchart TD
    TRIGGER["Git Push / Pull Request Event"] --> RUNNER["Gitea Actions Runner<br/>(macOS Intel x86_64)"]
    RUNNER --> STEP1["1. Verify Environment<br/>(Xcode 15+ / macOS 14 SDK)"]
    STEP1 --> STEP2["2. xcodebuild Compilation<br/>(generic/platform=macOS,arch=x86_64)"]
    STEP2 --> STEP3["3. Run XCTest Suite<br/>(Mocked AppleSMC & Mach providers)"]
    STEP3 --> STEP4["4. Archive & Package<br/>(Zip MacMonitor.app)"]
    STEP4 --> STEP5["5. Upload Build Artifact<br/>(MacMonitor-intel-x86_64.zip)"]

2. Workflow Specification (.gitea/workflows/build.yml)

name: MacMonitor Build & Test

on:
  push:
    branches:
      - main
      - develop
    tags:
      - 'v*'
  pull_request:
    branches:
      - main
      - develop

jobs:
  build-and-test:
    name: Build & Verify (Intel x86_64)
    runs-on: [macos, intel]

    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Verify Environment & Tools
        run: |
          sw_vers
          uname -m
          xcodebuild -version

      - name: Build MacMonitor (x86_64)
        run: |
          xcodebuild build \
            -scheme MacMonitor \
            -destination 'generic/platform=macOS,arch=x86_64' \
            -configuration Release \
            CODE_SIGNING_ALLOWED=NO \
            CODE_SIGNING_REQUIRED=NO

      - name: Run Test Suite
        run: |
          xcodebuild test \
            -scheme MacMonitor \
            -destination 'platform=macOS,arch=x86_64' \
            CODE_SIGNING_ALLOWED=NO

      - name: Archive Application Artifact
        if: startsWith(github.ref, 'refs/tags/v')
        run: |
          ditto -c -k --sequesterRsrc --keepParent \
            build/Release/MacMonitor.app \
            MacMonitor-intel-x86_64.zip

      - name: Upload Artifact
        if: startsWith(github.ref, 'refs/tags/v')
        uses: actions/upload-artifact@v4
        with:
          name: MacMonitor-Intel-Release
          path: MacMonitor-intel-x86_64.zip

3. Verification & Mocking in Unit Tests

Unit tests in CI test provider decoding logic against synthetic SMC and Mach structures (e.g. mock sp78 bytes, simulated vm_statistics64) ensuring tests execute reliably on runners without requiring physical AppleSMC hardware.

## Technical Implementation Plan & Code Solution ### 1. Gitea Actions Architecture The continuous integration pipeline automates building and verifying MacMonitor on self-hosted or managed macOS Intel runners. ```mermaid flowchart TD TRIGGER["Git Push / Pull Request Event"] --> RUNNER["Gitea Actions Runner<br/>(macOS Intel x86_64)"] RUNNER --> STEP1["1. Verify Environment<br/>(Xcode 15+ / macOS 14 SDK)"] STEP1 --> STEP2["2. xcodebuild Compilation<br/>(generic/platform=macOS,arch=x86_64)"] STEP2 --> STEP3["3. Run XCTest Suite<br/>(Mocked AppleSMC & Mach providers)"] STEP3 --> STEP4["4. Archive & Package<br/>(Zip MacMonitor.app)"] STEP4 --> STEP5["5. Upload Build Artifact<br/>(MacMonitor-intel-x86_64.zip)"] ``` --- ### 2. Workflow Specification (`.gitea/workflows/build.yml`) ```yaml name: MacMonitor Build & Test on: push: branches: - main - develop tags: - 'v*' pull_request: branches: - main - develop jobs: build-and-test: name: Build & Verify (Intel x86_64) runs-on: [macos, intel] steps: - name: Checkout Code uses: actions/checkout@v4 - name: Verify Environment & Tools run: | sw_vers uname -m xcodebuild -version - name: Build MacMonitor (x86_64) run: | xcodebuild build \ -scheme MacMonitor \ -destination 'generic/platform=macOS,arch=x86_64' \ -configuration Release \ CODE_SIGNING_ALLOWED=NO \ CODE_SIGNING_REQUIRED=NO - name: Run Test Suite run: | xcodebuild test \ -scheme MacMonitor \ -destination 'platform=macOS,arch=x86_64' \ CODE_SIGNING_ALLOWED=NO - name: Archive Application Artifact if: startsWith(github.ref, 'refs/tags/v') run: | ditto -c -k --sequesterRsrc --keepParent \ build/Release/MacMonitor.app \ MacMonitor-intel-x86_64.zip - name: Upload Artifact if: startsWith(github.ref, 'refs/tags/v') uses: actions/upload-artifact@v4 with: name: MacMonitor-Intel-Release path: MacMonitor-intel-x86_64.zip ``` --- ### 3. Verification & Mocking in Unit Tests Unit tests in CI test provider decoding logic against synthetic SMC and Mach structures (e.g. mock `sp78` bytes, simulated `vm_statistics64`) ensuring tests execute reliably on runners without requiring physical AppleSMC hardware.
gronod added this to the M1: Architecture Foundation & Hardware Abstraction milestone 2026-09-08 10:41:56 +01:00
Author
Owner

Implementation Completed (Milestone 1)

The Gitea Actions CI/CD Pipeline for Intel macOS Builds has been implemented in commit ad2695a on branch feat/25-gitea-ci and merged into milestone/m1-foundation (commit f034771).

Delivered Components:

  • Workflow Specification (.gitea/workflows/build.yml): Targeting [macos, intel] runners.
  • Triggers: Configured for push and pull_request events across main, develop, milestone/**, and feat/** branches.
  • Pipeline Steps:
    1. Environment and toolchain inspection (uname -m, sw_vers, xcodebuild -version, xcrun --show-sdk-path).
    2. Deterministic project generation via xcodegen generate with tracked .xcodeproj fallback.
    3. SwiftLint lint validation.
    4. Application compilation targeting generic/platform=macOS,arch=x86_64 with CODE_SIGNING_ALLOWED=NO.
    5. XCTest execution across all unit test suites piped through xcbeautify.
### Implementation Completed (Milestone 1) The Gitea Actions CI/CD Pipeline for Intel macOS Builds has been implemented in commit `ad2695a` on branch `feat/25-gitea-ci` and merged into `milestone/m1-foundation` (commit `f034771`). **Delivered Components:** - **Workflow Specification (`.gitea/workflows/build.yml`)**: Targeting `[macos, intel]` runners. - **Triggers**: Configured for `push` and `pull_request` events across `main`, `develop`, `milestone/**`, and `feat/**` branches. - **Pipeline Steps**: 1. Environment and toolchain inspection (`uname -m`, `sw_vers`, `xcodebuild -version`, `xcrun --show-sdk-path`). 2. Deterministic project generation via `xcodegen generate` with tracked `.xcodeproj` fallback. 3. SwiftLint lint validation. 4. Application compilation targeting `generic/platform=macOS,arch=x86_64` with `CODE_SIGNING_ALLOWED=NO`. 5. XCTest execution across all unit test suites piped through `xcbeautify`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: gronod/MacMonitor#25