|
| 1 | +# pluginval GitHub Actions |
| 2 | + |
| 3 | +Two composite actions for using pluginval from another repository's workflows. |
| 4 | +Their `action.yml` files are in `validate/` and `acceptance/` at the repository |
| 5 | +root, which keeps the references short; the scripts they run are in this directory. |
| 6 | +Both run on Linux, macOS and Windows runners, download the matching pluginval |
| 7 | +release (or use a binary you give them), run everything they are given and fail |
| 8 | +the step if anything failed. |
| 9 | + |
| 10 | +Results are shown in two places: the job summary gets a table with a row per |
| 11 | +plugin / config and its test count, followed by the name and message of every |
| 12 | +failed test; and each failed plugin / config gets an error annotation naming its |
| 13 | +failed tests, which also appears in the pull request's checks. |
| 14 | + |
| 15 | +On Linux the plugin is run under `xvfb-run` when there is no `DISPLAY` (install |
| 16 | +`xvfb` on runners that don't have it). |
| 17 | + |
| 18 | +## validate |
| 19 | + |
| 20 | +Validates one or more plugins. |
| 21 | + |
| 22 | +```yaml |
| 23 | +- uses: Tracktion/pluginval/validate@v2 |
| 24 | + with: |
| 25 | + plugins: | |
| 26 | + build/MyPlugin_artefacts/Release/VST3/MyPlugin.vst3 |
| 27 | + build/MyPlugin_artefacts/Release/AU/MyPlugin.component |
| 28 | + strictness-level: 10 |
| 29 | + args: --skip-gui-tests |
| 30 | +``` |
| 31 | +
|
| 32 | +| Input | Default | | |
| 33 | +| --- | --- | --- | |
| 34 | +| `plugins` | (required) | The plugins to validate, one per line. Each is a path, a glob or an AU id. A glob that matches nothing fails. | |
| 35 | +| `strictness-level` | `5` | The strictness level (1-10). | |
| 36 | +| `args` | | Extra options for `pluginval validate`, split on whitespace. | |
| 37 | +| `report-dir` | | Directory to write the JUnit XML reports to (a temporary directory if empty). | |
| 38 | +| `pluginval-version` | `v2.0.0-beta1` | The pluginval release to download: a tag, or `latest`. | |
| 39 | +| `pluginval-path` | | An existing pluginval binary to use instead of downloading one. | |
| 40 | + |
| 41 | +Every `pluginval validate` option can also be set as an environment variable on |
| 42 | +the step (e.g. `env: { TIMEOUT_MS: 60000 }`), which is the way to pass values |
| 43 | +containing spaces. |
| 44 | + |
| 45 | +## acceptance |
| 46 | + |
| 47 | +Runs the [acceptance tests](../../docs/Acceptance%20testing.md) for every config |
| 48 | +(`*.json`) found recursively under a directory, optionally against one built |
| 49 | +plugin. |
| 50 | + |
| 51 | +```yaml |
| 52 | +- uses: Tracktion/pluginval/acceptance@v2 |
| 53 | + with: |
| 54 | + config-dir: tests/acceptance |
| 55 | + plugin: build/MyPlugin_artefacts/Release/VST3/MyPlugin.vst3 |
| 56 | +``` |
| 57 | + |
| 58 | +| Input | Default | | |
| 59 | +| --- | --- | --- | |
| 60 | +| `config-dir` | (required) | Directory searched recursively for configs. | |
| 61 | +| `plugin` | | Plugin path or AU id to test every config against, instead of the `plugin` in each config. | |
| 62 | +| `record-missing` | `false` | Record a missing reference and pass, instead of failing. | |
| 63 | +| `timeout-ms` | | Fail a test if it takes longer than this (pluginval's default if empty). | |
| 64 | +| `report-dir` | | Directory to write the JUnit XML reports to (a temporary directory if empty). | |
| 65 | +| `pluginval-version` | `v2.0.0-beta1` | The pluginval release to download: a tag, or `latest`. | |
| 66 | +| `pluginval-path` | | An existing pluginval binary to use instead of downloading one. | |
| 67 | + |
| 68 | +Notes: |
| 69 | + |
| 70 | +- Every `*.json` under `config-dir` is treated as a config, apart from the |
| 71 | + `<reference>.wav.json` manifests. Keep other JSON files (and plugin bundles, |
| 72 | + which contain their own) out of it. |
| 73 | +- A config holding an array of tests is reported as a failure: use one config |
| 74 | + per file. |
| 75 | +- Relative `plugin` paths resolve against the working directory; the input, |
| 76 | + state and reference paths in a config resolve against the config's directory. |
| 77 | + |
| 78 | +## Outputs |
| 79 | + |
| 80 | +Both actions set: |
| 81 | + |
| 82 | +| Output | | |
| 83 | +| --- | --- | |
| 84 | +| `passed` / `failed` | How many plugins / configs passed and failed. | |
| 85 | +| `report-dir` | A directory holding a JUnit XML report for each one. For `acceptance` it also has a `diffs` directory with the `*-diff.wav` files found under `config-dir`. | |
| 86 | + |
| 87 | +To keep the reports and diffs from a failed run: |
| 88 | + |
| 89 | +```yaml |
| 90 | +- uses: Tracktion/pluginval/acceptance@v2 |
| 91 | + id: acceptance |
| 92 | + with: |
| 93 | + config-dir: tests/acceptance |
| 94 | + plugin: build/MyPlugin_artefacts/Release/VST3/MyPlugin.vst3 |
| 95 | +
|
| 96 | +- uses: actions/upload-artifact@v4 |
| 97 | + if: always() |
| 98 | + with: |
| 99 | + name: pluginval-acceptance-${{ runner.os }} |
| 100 | + path: ${{ steps.acceptance.outputs.report-dir }} |
| 101 | +``` |
| 102 | + |
| 103 | +### Per-test results as a pull request check |
| 104 | + |
| 105 | +The actions report failures through the job summary and annotations, which need |
| 106 | +no extra permissions. If you would rather have every pluginval test listed as its |
| 107 | +own check on the pull request, feed the JUnit reports to a reporter action such |
| 108 | +as [mikepenz/action-junit-report](https://github.com/mikepenz/action-junit-report) |
| 109 | +or [dorny/test-reporter](https://github.com/dorny/test-reporter): |
| 110 | + |
| 111 | +```yaml |
| 112 | +jobs: |
| 113 | + validate: |
| 114 | + runs-on: macos-latest |
| 115 | + permissions: |
| 116 | + contents: read |
| 117 | + checks: write |
| 118 | + steps: |
| 119 | + # ... build the plugin ... |
| 120 | +
|
| 121 | + - uses: Tracktion/pluginval/validate@v2 |
| 122 | + with: |
| 123 | + plugins: build/MyPlugin_artefacts/Release/VST3/MyPlugin.vst3 |
| 124 | + report-dir: pluginval-reports |
| 125 | +
|
| 126 | + - uses: mikepenz/action-junit-report@v5 |
| 127 | + if: always() |
| 128 | + with: |
| 129 | + report_paths: pluginval-reports/*.xml |
| 130 | + check_name: pluginval |
| 131 | +``` |
| 132 | + |
| 133 | +This needs the `checks: write` permission, which workflows triggered by pull |
| 134 | +requests from forks don't get, so on those the reporter step can't publish. |
0 commit comments