Skip to content

Add CI: build and generated-code comparison - #1

Merged
albertopeam merged 9 commits into
mainfrom
ci/github-actions
Oct 5, 2026
Merged

albertopeam merged 9 commits into
mainfrom
ci/github-actions

Conversation

@albertopeam

@albertopeam albertopeam commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

What

One GitHub Actions workflow, CI (.github/workflows/ci.yml), with a single build job. It runs on pull requests, on pushes to main and on demand. There is no scheduled run. The Xcode version comes from .xcode-version (26.5, as in create-ios), read by nomasystems/action-xcode-select@v0.2.

  1. Build: swift build.
  2. Generated sources are up to date: ./generate.sh --refresh and fail if git status is not clean.

Workflow to update the client

Regenerate locally with ./generate.sh --refresh, check that swift build succeeds, commit and open a pull request. The check confirms that what is committed is exactly what the generator produces. If Flowbox changes its published spec, later pull requests fail step 2 until the sources are regenerated and committed.

About the UnusedImportAccess warnings

Building prints 27 warnings (public import of 'Foundation' was not used in public declarations): swift-openapi-generator 1.13.1 puts the same public import lines in every generated file. It is a known upstream issue (#946, fix proposed in #947). The generated sources are the generator's raw output (identical to the 0.1.0 tag) and the CI does not check warnings.

Swift 6

Package.swift uses swift-tools-version:6.1 (the dependencies already required it), so the target is built in Swift 6 language mode: no errors and no concurrency diagnostics, and the public API is unchanged (1,135 symbols, identical to the 0.1.0 tag). Consumers in Swift 5 mode can still import it.

Notes

  • The job runs on [self-hosted, macOS, macstudio], the same labels and action as create-ios.
  • No secrets are needed.
  • Checked locally with Xcode 26.5: clean build, and regeneration leaves the committed sources unchanged.

🤖 Generated with Claude Code

- CI builds the package on pull requests and on pushes to main.
- Generated code regenerates from the current upstream spec and fails if the
  committed sources differ. It runs on pull requests touching the spec patch,
  the generator script, the manifest or the sources, and every Monday to
  detect changes in Flowbox's published spec.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@albertopeam albertopeam self-assigned this Oct 5, 2026
albertopeam and others added 2 commits October 5, 2026 11:32
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- CI regenerates from the current upstream spec and builds, failing on any
  warning or error in Sources/FlowboxAPI. No diff check against the committed
  sources.
- generate.sh rewrites `public import` to `import` in the generated files: the
  generator emits public imports that the compiler reports as unused
  (UnusedImportAccess), 27 warnings in total. The package builds in Swift 5
  language mode, where this changes nothing, and now builds with 0 warnings.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@albertopeam albertopeam changed the title Add CI: build and generated-code check Add CI: generate and build without warnings Oct 5, 2026
One job: build without warnings or errors, then regenerate from the current
upstream spec and fail if the committed sources differ. The flow is to
regenerate locally and open a pull request.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@albertopeam albertopeam changed the title Add CI: generate and build without warnings Add CI: clean build and generated-code comparison Oct 5, 2026
albertopeam and others added 4 commits October 5, 2026 12:11
…warning

Remove the rewrite of `public import` and filter, in the CI build check, the
UnusedImportAccess warnings the generator emits (swift-openapi-generator#946).
Any other warning or error still fails the job. The generated sources are
identical to the 0.1.0 tag again.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The build step teed its log to build.log in the checkout, which the
comparison step then reported as an untracked file and failed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
On the runner swift build colors its diagnostics, so the filter for the known
UnusedImportAccess warnings did not match and the step failed. Remove the
escape sequences before filtering.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add .xcode-version (read by nomasystems/action-xcode-select, as in create-ios)
and make the build step a plain `swift build`. The generator's
UnusedImportAccess warnings are known upstream and no longer checked.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@albertopeam albertopeam changed the title Add CI: clean build and generated-code comparison Add CI: build and generated-code comparison Oct 5, 2026
The dependencies already require tools 6.1, so 5.9 gave no compatibility.
The target now builds in Swift 6 language mode with no errors and no
concurrency diagnostics; the public API is unchanged (1,135 symbols identical
to the 0.1.0 tag). Swift 5 consumers can still import it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@albertopeam
albertopeam merged commit 4620b19 into main Oct 5, 2026
@albertopeam
albertopeam deleted the ci/github-actions branch October 5, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant