Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# The gate in front of main. Everything it runs lives once in
# CtrlAltDevelop/ci-workflows, so a fix there fixes all of the packages at
# once — format, analyze --fatal-infos, test, the example, a CHANGELOG entry
# for the pubspec version, and the pub.dev score with no points lost.
# Runs the tests on a pull request into main — and on nothing else.
# The job lives once in CtrlAltDevelop/ci-workflows (dart-test.yml).

name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
Expand All @@ -19,9 +14,9 @@ concurrency:
permissions: {}

jobs:
package:
name: Package
uses: CtrlAltDevelop/ci-workflows/.github/workflows/dart-package.yml@v1.1.0
test:
name: Test
uses: CtrlAltDevelop/ci-workflows/.github/workflows/dart-test.yml@v1.2.0
permissions:
contents: read
with:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Publishes the browser playground (example/web) to
# https://ctrlaltdevelop.github.io/openapi_enum_patch/ when a pull request is
# merged into main.
# Repo Settings → Pages → Source must be "GitHub Actions".

name: Pages

on:
push:
branches: [main]

concurrency:
group: pages
cancel-in-progress: true

permissions: {}

jobs:
build:
name: Build the playground
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: dart-lang/setup-dart@v1

- run: dart pub get

- name: Compile
run: |
mkdir -p site
cp example/web/index.html site/
dart compile js example/web/main.dart -O2 -o site/main.dart.js

- uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Publishes the package to pub.dev when a version tag is pushed.
#
# `v<version>` publishes that version. The checks (tag on main, matches the
# pubspec, has a CHANGELOG entry) and the one-off pub.dev setup live in
# CtrlAltDevelop/ci-workflows (dart-publish.yml).

name: Publish

on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]

permissions: {}

jobs:
publish:
name: Publish
uses: CtrlAltDevelop/ci-workflows/.github/workflows/dart-publish.yml@v1.2.0
permissions:
contents: read
id-token: write
with:
sdk: dart
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 1.4.0

- **`audit --json`** prints the report as JSON (`clean`, `schemaNamed` and a
`findings` list) instead of the text block, for CI annotations and
dashboards. `--strict` still sets the exit code. The same data is available
as `AuditReport.toJson()`.
- **Live playground** at https://ctrlaltdevelop.github.io/openapi_enum_patch/:
paste a schema and an `enum_overrides.yaml` and see the audit and the
generated enums, running the package's own code in the browser. Source in
`example/web`, published by a new Pages workflow on every merge to `main`.
- **Faster on large enums.** The audit and `patch` no longer scan a list for
every value they check — a 30,000-value enum with 3,000 extra values audits
about 5× faster — and `patch` stats each imported model file once instead of
once per import. No change to output.

## 1.3.1

- **Fixes to generated enum member names.**
Expand Down
Loading