You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add backwards-compatibility sub-action wrapping Roave's BC check
Wraps roave/backward-compatibility-check with --format=github-actions
so PR violations show up as inline annotations. Inputs: php-version
(default 8.2), extensions, from (default origin/<PR base ref>).
Wired into the root action with an if: github.event_name ==
'pull_request' guard, so root consumers don't break on non-PR
triggers. Standalone consumers scope their workflow to pull_request
or pass an explicit from ref.
This repository also ships a suite of composite GitHub Actions that implement the Setono Sylius plugin CI pipeline. Each check is its own sub-action, addressable as `setono/sylius-plugin/<name>@<ref>`, so consumers can run each in its own job with its own matrix. There is also a root action `setono/sylius-plugin@<ref>` listed on the GitHub Marketplace that runs all checks sequentially in one job — handy for trying it out, slow for real CI.
16
16
17
-
Eight actions ship in this repository:
17
+
Nine actions ship in this repository:
18
18
19
19
| Action | Purpose |
20
20
|---|---|
21
-
|`setono/sylius-plugin@<ref>`| Root action. Runs all seven checks sequentially in one job |
21
+
|`setono/sylius-plugin@<ref>`| Root action. Runs all eight checks sequentially in one job |
|`setono/sylius-plugin/integration-tests@<ref>`| MySQL + Doctrine schema validation against `tests/Application`|
27
27
|`setono/sylius-plugin/mutation-tests@<ref>`| Infection, with optional Stryker Dashboard reporting |
28
28
|`setono/sylius-plugin/code-coverage@<ref>`| PHPUnit with pcov, upload to Codecov |
29
+
|`setono/sylius-plugin/backwards-compatibility@<ref>`| Roave backward-compatibility-check against the PR base ref |
29
30
30
31
Pin the floating major (`@v2`) for automatic patch updates, or pin a specific tag (`@2.1.0`) for full reproducibility. Note the asymmetry: exact tags are bare-numeric (composer convention), the floating major uses the `v` prefix (action ecosystem convention).
31
32
@@ -212,6 +213,31 @@ jobs:
212
213
codecov-token: "${{ secrets.CODECOV_TOKEN }}"
213
214
```
214
215
216
+
#### `backwards-compatibility`
217
+
218
+
Wraps [Roave's `backward-compatibility-check`](https://github.com/Roave/BackwardCompatibilityCheck). Compares the PR's diff against its base ref and fails on any public-API break. Inline annotations show up directly on the changed lines via `--format=github-actions`.
219
+
220
+
| Input | Default | Description |
221
+
|---|---|---|
222
+
| `php-version` | `8.2` | PHP version to install |
| `from` | `origin/${{ github.event.pull_request.base.ref }}` | Git ref to compare against. The default only resolves on `pull_request` triggers — pass an explicit ref for other triggers |
225
+
226
+
The root action invokes this sub-action only on `pull_request` triggers (gated via `if:`), so it's safe to consume the root from any workflow. When invoking this sub-action standalone, scope the workflow to `on: pull_request` (or pass an explicit `from` ref).
The root action runs all seven sub-actions sequentially in a single job. **It is roughly five times slower than running the same checks as parallel jobs using the sub-actions**, because each sub-action repeats checkout + PHP setup + composer install. The root exists for the GitHub Marketplace listing and as a quick way to try the suite; for real CI, use the sub-actions in parallel jobs.
The repository SHALL provide seven composite GitHub Actions, each in its own subdirectory at the repo root with an `action.yml` file. Each sub-action MUST be invokable in a consumer workflow as `setono/sylius-plugin/<sub-action-name>@<ref>` and MUST be self-contained (it MUST NOT depend on any other sub-action in this repo).
8
+
The repository SHALL provide eight composite GitHub Actions, each in its own subdirectory at the repo root with an `action.yml` file. Each sub-action MUST be invokable in a consumer workflow as `setono/sylius-plugin/<sub-action-name>@<ref>` and MUST be self-contained (it MUST NOT depend on any other sub-action in this repo).
9
9
10
-
The seven sub-actions are:
10
+
The eight sub-actions are:
11
11
-`coding-standards`
12
12
-`dependency-analysis`
13
13
-`static-code-analysis`
14
14
-`unit-tests`
15
15
-`integration-tests`
16
16
-`mutation-tests`
17
17
-`code-coverage`
18
+
-`backwards-compatibility`
18
19
19
20
#### Scenario: Consumer invokes a single sub-action
20
21
@@ -120,6 +121,27 @@ The `code-coverage` sub-action SHALL install composer dependencies, run `vendor/
120
121
-**WHEN** the action is invoked with a valid `codecov-token`
121
122
-**THEN** clover coverage is generated and uploaded to Codecov successfully
122
123
124
+
### Requirement: Backwards compatibility sub-action runs Roave's backward-compatibility-check against the PR base ref
125
+
126
+
The `backwards-compatibility` sub-action SHALL check out the consumer's repo with `fetch-depth: 0`, install PHP, install `roave/backward-compatibility-check` via `composer global require`, then run `~/.composer/vendor/bin/roave-backward-compatibility-check --from=<from> --format=github-actions`. It SHALL accept inputs `php-version` (default `8.2`), `extensions` (default `intl, mbstring`), and `from` (default `origin/${{ github.event.pull_request.base.ref }}`).
127
+
128
+
The sub-action itself does not gate on event type. The root action MUST gate its invocation of `backwards-compatibility` with `if: github.event_name == 'pull_request'`, so the root remains safe to consume from any workflow. Standalone consumers SHALL scope their workflow to `on: pull_request` or pass an explicit `from` ref.
129
+
130
+
#### Scenario: PR-triggered invocation against the base ref
131
+
132
+
-**WHEN** the action is invoked from a `pull_request`-triggered workflow with no `from` input
133
+
-**THEN** the BC check runs against `origin/<base-ref>` and any public-API regression is reported as a GitHub Actions inline annotation on the offending source line
134
+
135
+
#### Scenario: Consumer overrides the comparison ref
136
+
137
+
-**WHEN** the action is invoked with an explicit `from` input (e.g., `from: 'origin/main'`)
138
+
-**THEN** the BC check runs against the provided ref instead of the PR base ref, allowing the action to work outside `pull_request` triggers
139
+
140
+
#### Scenario: Root action skips backwards-compatibility on non-PR triggers
141
+
142
+
-**WHEN** the root action is invoked from a non-`pull_request` trigger
143
+
-**THEN** the root's `if: github.event_name == 'pull_request'` guard skips the backwards-compatibility step entirely, so non-PR runs of the root succeed regardless of the BC sub-action's PR requirement
144
+
123
145
### Requirement: All actions follow GitHub composite-action constraints
124
146
125
147
Every `run:` step in every action SHALL declare `shell: bash`. No action SHALL declare a top-level `env:` block (composite actions don't support it). Environment variables that need to span multiple steps SHALL be set per-step via `env:` on each `run:` step that needs them.
@@ -140,7 +162,7 @@ Action releases SHALL reuse the repository's existing tag scheme (e.g., `2.0.0`,
140
162
141
163
### Requirement: README documents every sub-action and its inputs
142
164
143
-
`README.md` SHALL contain a section documenting each of the seven sub-actions and the root action: action reference path, all inputs (with defaults and descriptions), and at least one consumer usage example. Per the project's existing rule, no new feature is considered complete until the README reflects it.
165
+
`README.md` SHALL contain a section documenting each of the eight sub-actions and the root action: action reference path, all inputs (with defaults and descriptions), and at least one consumer usage example. Per the project's existing rule, no new feature is considered complete until the README reflects it.
144
166
145
167
#### Scenario: Consumer reads README to learn how to invoke the actions
0 commit comments