https://github.com/ply-ct/ply-action
GitHub action to execute Ply autotests
https://github.com/ply-ct/ply-action
autotest graphql ply rest
Last synced: 6 months ago
JSON representation
GitHub action to execute Ply autotests
- Host: GitHub
- URL: https://github.com/ply-ct/ply-action
- Owner: ply-ct
- License: mit
- Created: 2021-05-01T22:33:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-12T00:56:06.000Z (over 2 years ago)
- Last Synced: 2025-03-17T01:32:32.701Z (7 months ago)
- Topics: autotest, graphql, ply, rest
- Language: TypeScript
- Homepage:
- Size: 21.4 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ply Action
GitHub action to execute [Ply](https://github.com/ply-ct/ply#readme) autotests.
You can also display a badge  indicating success or failure.## Example workflow file
```yaml
jobs:
ply:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
- run: npm install
- uses: ply-ct/ply-action@v3.0
```
This example runs all Ply tests and fails if they don't succeed.## Ply results badge
A Ply badge can easily be added to public repositories, like this example from [ply-demo](https://github.com/ply-ct/ply-demo):
```markdown
```
In fact, ply-action is not even required for this feature. The badge URL above follows the
same pattern as [GitHub workflow status badges](https://docs.github.com/en/actions/managing-workflow-runs/adding-a-workflow-status-badge).
The standard GitHub badge URL for ply-demo's workflow is `https://github.com/ply-ct/ply-demo/workflows/build/badge.svg`,
whereas to display a Ply badge for the same workflow the URL is `https://ply-ct.org/badges/ply-ct/ply-demo/workflows/build`.
Basically the same path (`//workflows/`). This works for public repositories because Ply is
able to retrieve their workflow build status. The question mark at the end of the URL is to prevent overly-aggressive GitHub CDN caching.## Private repositories
Private repositories can use ply-action as in the example above, but to include a badge some additional configuration is needed:
```yaml
- uses: ply-ct/ply-action@v3.0
with:
github-token: ${{ secrets.MY_GITHUB_TOKEN }}
badge-branch: badge
badge-path: ply-badge.svg
```
This directs ply-action to commit and push the current status badge to the ([orphan](https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt---orphanltnewbranchgt))
branch named 'badge'. It's orphanness keeps the branch clean. No need to create the branch ahead of time. Once you've executed the workflow, its
Ply badge can be referenced from your own repository:
```markdown

```## External execution
If you've already integrated Ply CLI commands into a GitHub workflow (say with code coverage metrics), you may prefer to
skip Ply test execution altogether, and use ply-action simply to perform a badge commit based on the results of previous Ply CLI run.
In that case, specify the path to an overall Ply results file created using the `--resultFile` [CLI arg](https://ply-ct.org/ply/topics/config):
```yaml
- uses: ply-ct/ply-action@v3.0
with:
ply-path: node_modules/ply-ct/ply
result-file: test/api/results/actual/ply-results.json
github-token: ${{ secrets.MY_GITHUB_TOKEN }}
badge-branch: badge
badge-path: ply-badge.svg
```## Inputs
| **Name** | **Default** | **Description** |
| ------------ | -------------------------| ------------------------------------------------------------------------------------------------------|
| cwd | . | Working directory for ply execution |
| ply-path | node_modules/@ply-ct/ply | Path to ply npm package |
| values-files | (from plyconfig file) | Override valuesFiles from plyconfig.json/yaml/yml (newline-delimited) |
| result-file | | Result file in case Ply tests were already run in a previous workflow/job |
| badge-branch | | Branch to contain status badge (eg: "badge"). Needed to display Ply badge for private repositories. |
| badge-path | ply-badge.svg | Save badge to this file path (relative to repo root). Only used with badge-branch. |
| github-token | | GitHub token for pushing badge updates. Required if badge-branch input is specified. |