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
16 changes: 3 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: CI
on:
push:
branches: [master]
pull_request:
types: [opened, edited, synchronize, reopened]
types: [opened, synchronize, reopened]
workflow_dispatch:
permissions: {}
jobs:
Expand All @@ -27,17 +28,6 @@ jobs:
contents: read
actions: read
uses: ./.github/workflows/swift-package.yml
policy:
permissions:
contents: read
uses: ./.github/workflows/policy.yml
with:
allow-terms: |
ChatGPT
Codex
Cursor
Claude
dependabot-exception: true
fixtures:
runs-on: ${{ matrix.runner }}
permissions:
Expand Down Expand Up @@ -107,7 +97,7 @@ jobs:
tap: agents-tools/workflow-fixture
tap-directory: fixtures/homebrew
result:
needs: [checks, validate, policy, fixtures, demo-fixture, homebrew]
needs: [checks, validate, fixtures, demo-fixture, homebrew]
if: always()
runs-on: ubuntu-24.04
permissions:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/source-policy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Source policy
on:
push: {}
push:
branches: [master]
pull_request:
types: [opened, edited, synchronize, reopened]
workflow_dispatch: {}
Expand Down
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,44 @@ publishes them.
## Calling validation and policy

Swift members such as `agents-tools/core`, `agents-tools/cli` and `skill-cli/cli`
use the same configuration reference and workflow calls:
use the same configuration reference and workflow calls.

Callers run validation once for each pull-request push, once for each push to
the default branch and on manual dispatch. Source policy runs on pull requests
and default-branch pushes, and also when a pull request is edited, because it
checks the title:

```yaml
name: CI
on:
push:
branches: [master]
pull_request:
types: [opened, edited, synchronize, reopened]
types: [opened, synchronize, reopened]
workflow_dispatch:
permissions:
contents: read
actions: read
jobs:
validate:
uses: agents-tools/github-workflows/.github/workflows/swift-package.yml@<full-sha> # vX.Y.Z
```

```yaml
name: Source policy
on:
push:
branches: [master]
pull_request:
types: [opened, edited, synchronize, reopened]
permissions:
contents: read
jobs:
policy:
uses: agents-tools/github-workflows/.github/workflows/policy.yml@<full-sha> # vX.Y.Z
with:
allow-terms: ''
dependabot-exception: true
validate:
uses: agents-tools/github-workflows/.github/workflows/swift-package.yml@<full-sha> # vX.Y.Z
```

`allow-terms` is a newline-separated, case-insensitive product-name allowlist.
Expand Down Expand Up @@ -296,7 +315,8 @@ changed-step diagnostic and recording diff. Build and toolchain errors fail the
harness. Regenerate the passing recording with the same toolchain's
`node <toolchain>/src/cli.ts terminal record --script <script.yml> --executable <built-cli> --out <recording.json>`.

CI calls the validation and policy workflows with passing fixture packages.
CI calls the validation workflow with passing fixture packages, and the source
policy workflow calls the policy workflow for this repository's own changes.
The root configuration targets `fixtures/passing` and declares every validation
job type. The scripts exercise each job's rejection path against failing
fixtures on its matching runner. A failing reusable-workflow call cannot be an
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class CIResultTests(unittest.TestCase):
def test_all_dependencies_must_succeed(self):
needs = {name: {'result': 'success'}
for name in ('checks', 'validate', 'policy', 'fixtures', 'demo-fixture')}
for name in ('checks', 'validate', 'fixtures', 'demo-fixture', 'homebrew')}
ci.check(needs)
for name in needs:
for result in ('failure', 'cancelled', 'skipped'):
Expand Down
Loading