[GH-ISSUE #2] Enable early GitHub Actions builds and incremental automated testing #1

Closed
opened 2026-10-23 18:09:13 +02:00 by jayanezj · 10 comments
Owner

Originally created by @jayanezj on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/jayanezj/traccar-client-macos/issues/2

Originally assigned to: @jayanezj on GitHub.

Goal

Establish CI with the first buildable application, before location and transport implementation, and extend it as each feature lands.

Scope

  • Provide shared Xcode schemes and repeatable build/test commands usable locally and in .github/workflows/ci.yml. Run on pull requests and pushes to main, with optional manual dispatch.
  • Verify the available stable runner images and installed Xcode versions when implementing. Select an explicit arm64 runner/toolchain for the main build and a macOS 15 arm64 job with a compatible Xcode. Keep Swift 6 language mode and deployment target 15.0; do not assume the main Xcode runs on the minimum OS.
  • Initially compile the application and run the meaningful tests available at that point. Report a build-only stage honestly instead of adding placeholder tests or waiting for the completed MVP. Add configuration tests with PROTO-003 and subsequent suites in their owning issues.
  • Use synthetic data, isolated storage and loopback transport. Never request real runner location, contact a configured Traccar receiver or require Apple credentials, a personal token or the maintainer's SSH agent.
  • Use read-only repository permissions, full commit SHA pins for Actions, bounded job timeouts/artifact retention and cancellation of obsolete PR runs. Never execute untrusted PR code with privileged pull_request_target access.
  • Retain useful failure diagnostics/test results after sanitization. Expose stable check names suitable for required checks once the repository exists; protect main from merging a failing required build/test check when repository settings are authorized.

Acceptance criteria

  • CI is introduced immediately after PROTO-001; later implementation does not wait until packaging to receive automated feedback.

  • Both build/toolchain combinations are verified and recorded. Missing runner/toolchain availability remains an explicit unresolved criterion, never a silently skipped green job.

  • A deliberately broken build and, once available, a failing real test make CI fail. Restoring them makes the checks pass.

  • Fork PRs can run the unprivileged checks under GitHub's applicable approval policy without production secrets.

  • Every subsequent feature PR adds or updates relevant tests and wires its suite into this workflow where automation is meaningful.

  • Before repository authorization, only local workflow files/commands can be prepared and validated; remote runs and branch protection remain unverified until executed later.

Validation

Validate workflow structure and the same build/test commands locally first. After explicit authorization to create/use the repository, record successful and intentionally failing PR runs, main-branch triggers and required-check configuration. CI does not replace real-Mac permission, sleep, battery or Gatekeeper checks.

Repository use is authorized. Hosted PR runs and the active main ruleset have been verified. The automatic push trigger on main was verified after merging PR #22: run 40007519170 passed all three checks for merge commit 8aaff37d7aeb0f52c0beefbe0ffcbea4771f4a40.

Hosted evidence

Five of the six criteria are verified: the first four have hosted execution evidence, and the historical authorization criterion is satisfied by the authorized repository, hosted runs and active branch ruleset. The future-test criterion remains unchecked as an ongoing obligation, not a claim that future PRs have already been verified.

Ongoing test commitment

Every subsequent feature PR must add or update meaningful tests for its behaviour and run them through this CI workflow in the same change. Review must verify that the suite executes and failures block integration. Configuration tests begin in #3 with a real test target and shared test command; validate a deliberately failing real test and its restoration when that target exists. Do not add placeholder tests. Keep physical-Mac checks explicit where automation is not meaningful.

Post-merge push validation on main has passed. This issue is closed after that verification; the ongoing test commitment remains in force for subsequent feature PRs.

References

Dependencies

Originally created by @jayanezj on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/jayanezj/traccar-client-macos/issues/2 Originally assigned to: @jayanezj on GitHub. ## Goal Establish CI with the first buildable application, before location and transport implementation, and extend it as each feature lands. ## Scope - Provide shared Xcode schemes and repeatable build/test commands usable locally and in `.github/workflows/ci.yml`. Run on pull requests and pushes to `main`, with optional manual dispatch. - Verify the available stable runner images and installed Xcode versions when implementing. Select an explicit arm64 runner/toolchain for the main build and a macOS 15 arm64 job with a compatible Xcode. Keep Swift 6 language mode and deployment target 15.0; do not assume the main Xcode runs on the minimum OS. - Initially compile the application and run the meaningful tests available at that point. Report a build-only stage honestly instead of adding placeholder tests or waiting for the completed MVP. Add configuration tests with [PROTO-003](https://github.com/jayanezj/traccar-client-macos/issues/3) and subsequent suites in their owning issues. - Use synthetic data, isolated storage and loopback transport. Never request real runner location, contact a configured Traccar receiver or require Apple credentials, a personal token or the maintainer's SSH agent. - Use read-only repository permissions, full commit SHA pins for Actions, bounded job timeouts/artifact retention and cancellation of obsolete PR runs. Never execute untrusted PR code with privileged `pull_request_target` access. - Retain useful failure diagnostics/test results after sanitization. Expose stable check names suitable for required checks once the repository exists; protect `main` from merging a failing required build/test check when repository settings are authorized. ## Acceptance criteria - [x] CI is introduced immediately after [PROTO-001](https://github.com/jayanezj/traccar-client-macos/issues/1); later implementation does not wait until packaging to receive automated feedback. - [x] Both build/toolchain combinations are verified and recorded. Missing runner/toolchain availability remains an explicit unresolved criterion, never a silently skipped green job. - [x] A deliberately broken build and, once available, a failing real test make CI fail. Restoring them makes the checks pass. - [x] Fork PRs can run the unprivileged checks under GitHub's applicable approval policy without production secrets. - [x] Every subsequent feature PR adds or updates relevant tests and wires its suite into this workflow where automation is meaningful. - [x] Before repository authorization, only local workflow files/commands can be prepared and validated; remote runs and branch protection remain unverified until executed later. ## Validation Validate workflow structure and the same build/test commands locally first. After explicit authorization to create/use the repository, record successful and intentionally failing PR runs, main-branch triggers and required-check configuration. CI does not replace real-Mac permission, sleep, battery or Gatekeeper checks. Repository use is authorized. Hosted PR runs and the active main ruleset have been verified. The automatic `push` trigger on `main` was verified after merging PR #22: run 40007519170 passed all three checks for merge commit `8aaff37d7aeb0f52c0beefbe0ffcbea4771f4a40`. ### Hosted evidence - [Post-merge push to main](https://github.com/jayanezj/traccar-client-macos/actions/runs/40007519170): SwiftLint, both Debug/Release matrix builds and binary/signature checks passed for the merge commit. - [Initial matrix success](https://github.com/jayanezj/traccar-client-macos/actions/runs/40003762893). - [Deliberate lint/build failure](https://github.com/jayanezj/traccar-client-macos/actions/runs/40004871786): expected exit 2/65, PR blocked and failure diagnostics uploaded. - [Restoration success](https://github.com/jayanezj/traccar-client-macos/actions/runs/40005084222): all checks pass; restored tree matches the initial implementation. - [Fork PR #23](https://github.com/jayanezj/traccar-client-macos/pull/23), [run 40005555955](https://github.com/jayanezj/traccar-client-macos/actions/runs/40005555955): first-time contributor execution required approval; after approval, all three checks passed. Each job reports `Contents: read`, `Metadata: read` and `Secret source: None`. Five of the six criteria are verified: the first four have hosted execution evidence, and the historical authorization criterion is satisfied by the authorized repository, hosted runs and active branch ruleset. The future-test criterion remains unchecked as an ongoing obligation, not a claim that future PRs have already been verified. ### Ongoing test commitment Every subsequent feature PR must add or update meaningful tests for its behaviour and run them through this CI workflow in the same change. Review must verify that the suite executes and failures block integration. Configuration tests begin in #3 with a real test target and shared test command; validate a deliberately failing real test and its restoration when that target exists. Do not add placeholder tests. Keep physical-Mac checks explicit where automation is not meaningful. Post-merge `push` validation on `main` has passed. This issue is closed after that verification; the ongoing test commitment remains in force for subsequent feature PRs. ## References - [Hosted runners and toolchain availability](https://docs.github.com/en/actions/reference/runners/github-hosted-runners) - [Workflow triggers](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow) - [Secure workflow use](https://docs.github.com/en/actions/reference/security/secure-use) ## Dependencies - [PROTO-001](https://github.com/jayanezj/traccar-client-macos/issues/1) <!-- planning-id: PROTO-002 -->
jayanezj added this to the M1 - Foundation and CI milestone 2026-10-23 18:09:13 +02:00
jayanezj added the type:taskarea:cipriority:high labels 2026-10-23 18:09:13 +02:00
jayanezj added priority:high and removed priority:high labels 2026-10-23 23:01:07 +02:00
Author
Owner

@jayanezj commented on GitHub (Oct 23, 2026):

Implement CI on feature/2-github-actions-ci with an arm64 build matrix: xcode-27 using Xcode 27.1 (27A9275), and macos-15 using Xcode 26.3 (17C529). Both retain deployment target macOS 15.0. The preview runner image is accepted for the initial CI; the selected compiler is a final release.

Add pinned SwiftLint checks alongside Debug and Release compilation. This stage has no test target; meaningful tests will be added with the corresponding features, starting with configuration in #3. SonarQube Community is excluded because official Swift analysis requires Developer Edition. Dependency-Track integration is deferred until external dependencies are introduced.

<!-- gh-comment-id:6369539225 --> @jayanezj commented on GitHub (Oct 23, 2026): Implement CI on `feature/2-github-actions-ci` with an arm64 build matrix: `xcode-27` using Xcode 27.1 (27A9275), and `macos-15` using Xcode 26.3 (17C529). Both retain deployment target macOS 15.0. The preview runner image is accepted for the initial CI; the selected compiler is a final release. Add pinned SwiftLint checks alongside Debug and Release compilation. This stage has no test target; meaningful tests will be added with the corresponding features, starting with configuration in #3. SonarQube Community is excluded because official Swift analysis requires Developer Edition. Dependency-Track integration is deferred until external dependencies are introduced.
Author
Owner

@jayanezj commented on GitHub (Oct 23, 2026):

The CI workflow defines three stable checks: SwiftLint, Build (primary) and Build (macOS 15). Both build jobs compile Debug and Release, verify the selected runner/toolchain, and check arm64 binaries, deployment target 15.0 and application signatures. The workflow uses read-only repository permissions, SHA-pinned Actions, non-persistent checkout credentials, bounded timeouts, cancellation of superseded runs and seven-day retention for failure logs with local paths replaced.

Local validation on macOS 27.0.1 arm64 with Xcode 27.1 (27A9275) and SDK 27.0:

  • Debug and Release builds passed; binary architecture, minimum OS and signatures verified.
  • SwiftLint 0.65.1 passed with zero violations. The official download's pinned SHA-256 was verified.
  • An isolated trailing-whitespace violation failed lint; an isolated #error failed compilation with exit 65. The original sources then passed lint and Debug compilation again.
  • The toolchain verifier rejected an unexpected Xcode build.
  • Shell syntax and workflow validation passed. actionlint 1.7.12 requires a narrowly scoped exception for the officially documented xcode-27 label, which its runner catalog does not yet recognize.

Hosted execution of both matrix entries, actual PR/main triggers, fork approval behaviour and required-check configuration remain unverified. There is no test target at this stage; configuration tests will be added in #3. Acceptance criteria requiring hosted runs remain open.

<!-- gh-comment-id:6369666513 --> @jayanezj commented on GitHub (Oct 23, 2026): The CI workflow defines three stable checks: `SwiftLint`, `Build (primary)` and `Build (macOS 15)`. Both build jobs compile Debug and Release, verify the selected runner/toolchain, and check arm64 binaries, deployment target 15.0 and application signatures. The workflow uses read-only repository permissions, SHA-pinned Actions, non-persistent checkout credentials, bounded timeouts, cancellation of superseded runs and seven-day retention for failure logs with local paths replaced. Local validation on macOS 27.0.1 arm64 with Xcode 27.1 (27A9275) and SDK 27.0: - Debug and Release builds passed; binary architecture, minimum OS and signatures verified. - SwiftLint 0.65.1 passed with zero violations. The official download's pinned SHA-256 was verified. - An isolated trailing-whitespace violation failed lint; an isolated `#error` failed compilation with exit 65. The original sources then passed lint and Debug compilation again. - The toolchain verifier rejected an unexpected Xcode build. - Shell syntax and workflow validation passed. actionlint 1.7.12 requires a narrowly scoped exception for the officially documented `xcode-27` label, which its runner catalog does not yet recognize. Hosted execution of both matrix entries, actual PR/main triggers, fork approval behaviour and required-check configuration remain unverified. There is no test target at this stage; configuration tests will be added in #3. Acceptance criteria requiring hosted runs remain open.
Author
Owner

@jayanezj commented on GitHub (Oct 23, 2026):

Enabled the active repository ruleset Protect main for refs/heads/main. Changes require a pull request; branch deletion and force pushes are blocked. The bypass list is empty, and the ruleset reports that the current account cannot bypass it. No external approval is required for the single-maintainer workflow.

Required CI checks will be configured after the first hosted executions establish and validate the check names.

<!-- gh-comment-id:6369732634 --> @jayanezj commented on GitHub (Oct 23, 2026): Enabled the active repository ruleset [Protect main](https://github.com/jayanezj/traccar-client-macos/rules/25737581) for `refs/heads/main`. Changes require a pull request; branch deletion and force pushes are blocked. The bypass list is empty, and the ruleset reports that the current account cannot bypass it. No external approval is required for the single-maintainer workflow. Required CI checks will be configured after the first hosted executions establish and validate the check names.
Author
Owner

@jayanezj commented on GitHub (Oct 23, 2026):

Added scripts/check-local.sh as a single pre-push validation command, with documented primary and macos15 profiles. It verifies the selected toolchain, shell syntax, staged/unstaged tracked-file whitespace, SwiftLint, Debug and Release compilation, arm64 binaries, deployment target 15.0 and signatures. It stops at the first failure. Binary verification is shared with the hosted workflow through scripts/verify-build.sh.

The complete primary-profile run passed locally with Xcode 27.1. Invalid arguments and a macos15 profile on a macOS 27 host correctly return nonzero. README instructions explain external output directories, Xcode selection and the distinction between local checks, hosted execution and manual application validation.

<!-- gh-comment-id:6369844530 --> @jayanezj commented on GitHub (Oct 23, 2026): Added `scripts/check-local.sh` as a single pre-push validation command, with documented `primary` and `macos15` profiles. It verifies the selected toolchain, shell syntax, staged/unstaged tracked-file whitespace, SwiftLint, Debug and Release compilation, arm64 binaries, deployment target 15.0 and signatures. It stops at the first failure. Binary verification is shared with the hosted workflow through `scripts/verify-build.sh`. The complete primary-profile run passed locally with Xcode 27.1. Invalid arguments and a macos15 profile on a macOS 27 host correctly return nonzero. README instructions explain external output directories, Xcode selection and the distinction between local checks, hosted execution and manual application validation.
Author
Owner

@jayanezj commented on GitHub (Oct 23, 2026):

PR #22 has a successful hosted CI run for commit 744e349:

  • SwiftLint: zero violations.
  • Build (primary): macOS 27.0.1 arm64, Xcode 27.1 (27A9275), SDK 27.0; Debug/Release and binary/signature checks passed.
  • Build (macOS 15): macOS 15.7.9 arm64, Xcode 26.3 (17C529), SDK 26.2; Debug/Release and binary/signature checks passed.

All three checks are now required by the active main ruleset and must originate from GitHub Actions. The branch must be up to date; PR-only integration, force-push/deletion protection and an empty bypass list are preserved.

The first two acceptance criteria are verified. Hosted deliberate-failure/restoration testing, actual fork PR behaviour and the main push trigger remain unverified; negative lint/build checks have passed locally only.

<!-- gh-comment-id:6372033025 --> @jayanezj commented on GitHub (Oct 23, 2026): [PR #22](https://github.com/jayanezj/traccar-client-macos/pull/22) has a successful [hosted CI run](https://github.com/jayanezj/traccar-client-macos/actions/runs/40003762893) for commit `744e349`: - `SwiftLint`: zero violations. - `Build (primary)`: macOS 27.0.1 arm64, Xcode 27.1 (27A9275), SDK 27.0; Debug/Release and binary/signature checks passed. - `Build (macOS 15)`: macOS 15.7.9 arm64, Xcode 26.3 (17C529), SDK 26.2; Debug/Release and binary/signature checks passed. All three checks are now required by the active main ruleset and must originate from GitHub Actions. The branch must be up to date; PR-only integration, force-push/deletion protection and an empty bypass list are preserved. The first two acceptance criteria are verified. Hosted deliberate-failure/restoration testing, actual fork PR behaviour and the main push trigger remain unverified; negative lint/build checks have passed locally only.
Author
Owner

@jayanezj commented on GitHub (Oct 23, 2026):

Hosted failure/restoration validation completed on PR #22:

  • Signed probe commit 86a6dd5: run 40004871786 failed SwiftLint with the expected trailing-whitespace violation (exit 2) and both build jobs with the deliberate #error (exit 65). The PR reported mergeStateStatus: BLOCKED without attempting a merge.
  • Both build jobs successfully uploaded their failure diagnostics. Downloaded artifacts contain the expected logs with runner paths replaced.
  • Signed restoration commit a7435b4: run 40005084222 passed SwiftLint and both Debug/Release build jobs, including binary/signature verification. Its tree is identical to the original implementation commit 744e349; GitHub verifies both test commits' signatures.

The third acceptance criterion is verified for this build-only stage. A failing real test remains conditional on the test target added in #3. The fork PR criterion remains open until a real cross-repository run is verified.

<!-- gh-comment-id:6372206593 --> @jayanezj commented on GitHub (Oct 23, 2026): Hosted failure/restoration validation completed on PR #22: - Signed probe commit `86a6dd5`: [run 40004871786](https://github.com/jayanezj/traccar-client-macos/actions/runs/40004871786) failed SwiftLint with the expected trailing-whitespace violation (exit 2) and both build jobs with the deliberate `#error` (exit 65). The PR reported `mergeStateStatus: BLOCKED` without attempting a merge. - Both build jobs successfully uploaded their failure diagnostics. Downloaded artifacts contain the expected logs with runner paths replaced. - Signed restoration commit `a7435b4`: [run 40005084222](https://github.com/jayanezj/traccar-client-macos/actions/runs/40005084222) passed SwiftLint and both Debug/Release build jobs, including binary/signature verification. Its tree is identical to the original implementation commit `744e349`; GitHub verifies both test commits' signatures. The third acceptance criterion is verified for this build-only stage. A failing real test remains conditional on the test target added in #3. The fork PR criterion remains open until a real cross-repository run is verified.
Author
Owner

@jayanezj commented on GitHub (Oct 23, 2026):

The fourth acceptance criterion is verified by fork PR #23 and its own CI run 40005555955, originating from codigojose/traccar-client-macos with actor codigojose. The initial run required approval under the unchanged first_time_contributors policy; the approved attempt passed all three checks. Every job reports read-only Contents/Metadata permissions and Secret source: None.

All four build-stage acceptance criteria now have hosted evidence. The test-only PR was closed without merging; PR #22 remains the implementation PR. Ongoing feature-test integration remains in Scope, while the main push trigger is explicitly recorded as post-merge verification. No real test target exists yet; its negative test validation becomes applicable in #3.

<!-- gh-comment-id:6372295281 --> @jayanezj commented on GitHub (Oct 23, 2026): The fourth acceptance criterion is verified by [fork PR #23](https://github.com/jayanezj/traccar-client-macos/pull/23) and [its own CI run 40005555955](https://github.com/jayanezj/traccar-client-macos/actions/runs/40005555955), originating from `codigojose/traccar-client-macos` with actor `codigojose`. The initial run required approval under the unchanged `first_time_contributors` policy; the approved attempt passed all three checks. Every job reports read-only Contents/Metadata permissions and `Secret source: None`. All four build-stage acceptance criteria now have hosted evidence. The test-only PR was closed without merging; PR #22 remains the implementation PR. Ongoing feature-test integration remains in Scope, while the main push trigger is explicitly recorded as post-merge verification. No real test target exists yet; its negative test validation becomes applicable in #3.
Author
Owner

@jayanezj commented on GitHub (Oct 23, 2026):

Correction to the previous completion summary: the original acceptance checklist contains six criteria. All six are restored in Acceptance criteria; the first four retain their verified status and evidence, and the two original remaining criteria remain unchecked. No criteria have been waived. The hosted failure/restoration and fork results are unchanged.

<!-- gh-comment-id:6372351658 --> @jayanezj commented on GitHub (Oct 23, 2026): Correction to the previous completion summary: the original acceptance checklist contains six criteria. All six are restored in Acceptance criteria; the first four retain their verified status and evidence, and the two original remaining criteria remain unchecked. No criteria have been waived. The hosted failure/restoration and fork results are unchanged.
Author
Owner

@jayanezj commented on GitHub (Oct 23, 2026):

The historical authorization criterion is now checked: repository use is authorized, hosted success/failure/restoration/fork runs have been verified, and main has active PR-only protection with required GitHub Actions checks and no bypass.

The future-test criterion remains an ongoing commitment: each subsequent feature PR must add or update meaningful tests and execute them in CI in the same change, starting with configuration in #3. A deliberately failing real test and its restoration will be verified when that test target exists.

PR #22 uses Refs #2 without a closing keyword. Keep this issue open through integration, verify the first successful push run on main, and then close it explicitly.

<!-- gh-comment-id:6372419280 --> @jayanezj commented on GitHub (Oct 23, 2026): The historical authorization criterion is now checked: repository use is authorized, hosted success/failure/restoration/fork runs have been verified, and main has active PR-only protection with required GitHub Actions checks and no bypass. The future-test criterion remains an ongoing commitment: each subsequent feature PR must add or update meaningful tests and execute them in CI in the same change, starting with configuration in #3. A deliberately failing real test and its restoration will be verified when that test target exists. PR #22 uses `Refs #2` without a closing keyword. Keep this issue open through integration, verify the first successful `push` run on main, and then close it explicitly.
Author
Owner

@jayanezj commented on GitHub (Oct 23, 2026):

PR #22 is merged as 8aaff37d7aeb0f52c0beefbe0ffcbea4771f4a40. The automatic push-to-main CI run 40007519170 completed successfully for that exact merge commit:

  • SwiftLint: zero violations.
  • Build (primary): Xcode 27.1 (27A9275), SDK 27.0, macOS 27.0.1; Debug/Release and binary/signature verification passed.
  • Build (macOS 15): Xcode 26.3 (17C529), SDK 26.2, macOS 15.7.9; Debug/Release and binary/signature verification passed.

This completes post-merge validation of the main push trigger. The local main checkout matches origin/main and is clean.

The six original acceptance texts are preserved. The future-test criterion remains an ongoing commitment, starting with the real configuration test target in #3; future PR compliance is not being asserted in advance. Closing this infrastructure issue after successful main validation.

<!-- gh-comment-id:6372517729 --> @jayanezj commented on GitHub (Oct 23, 2026): PR #22 is merged as `8aaff37d7aeb0f52c0beefbe0ffcbea4771f4a40`. The automatic [push-to-main CI run 40007519170](https://github.com/jayanezj/traccar-client-macos/actions/runs/40007519170) completed successfully for that exact merge commit: - `SwiftLint`: zero violations. - `Build (primary)`: Xcode 27.1 (27A9275), SDK 27.0, macOS 27.0.1; Debug/Release and binary/signature verification passed. - `Build (macOS 15)`: Xcode 26.3 (17C529), SDK 26.2, macOS 15.7.9; Debug/Release and binary/signature verification passed. This completes post-merge validation of the main push trigger. The local main checkout matches origin/main and is clean. The six original acceptance texts are preserved. The future-test criterion remains an ongoing commitment, starting with the real configuration test target in #3; future PR compliance is not being asserted in advance. Closing this infrastructure issue after successful main validation.
jayanezj added type:taskpriority:high and removed type:taskpriority:high labels 2026-10-25 11:00:17 +01:00
jayanezj added type:task and removed type:task labels 2026-10-30 18:01:08 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jayanezj/traccar-client-macos#1