Skip to content

Commit

Permalink
GH-240 move test fixtures to folders to separate action and workflow …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
larmitage-bjss committed Feb 13, 2024
1 parent fd431d7 commit 36dc07a
Show file tree
Hide file tree
Showing 48 changed files with 611 additions and 71 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions __tests__/fixtures/action/action_docs_action_readme.input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- action-docs-inputs action="__tests__/fixtures/action/action_docs_action_action.yml" -->
10 changes: 10 additions & 0 deletions __tests__/fixtures/action/action_docs_action_readme.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- action-docs-inputs action="__tests__/fixtures/action/action_docs_action_action.yml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `readme` | <p>Readme file to update.</p> | `false` | `README.md` |
| `actionFile` | <p>The action definition file.</p> | `false` | `action.yml` |
| `tocLevel` | <p>TOC level used for the headers.</p> | `false` | `2` |
| `lineBreaks` | <p>Line breaks to be used in updated readme (LF|CR|CRLF).</p> | `false` | `LF` |
<!-- action-docs-inputs action="__tests__/fixtures/action/action_docs_action_action.yml" -->
1 change: 1 addition & 0 deletions __tests__/fixtures/action/action_usage_readme.input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- action-docs-usage action="__tests__/fixtures/action/action.yml" project="npalm/action-docs" version="v1" -->
25 changes: 25 additions & 0 deletions __tests__/fixtures/action/action_usage_readme.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- action-docs-usage action="__tests__/fixtures/action/action.yml" project="npalm/action-docs" version="v1" -->
## Usage

```yaml
- uses: npalm/action-docs@v1
with:
inputA:
# - Item 1
# - foo, bar, baz
# - Item 2
# - [github](https://github.com/)
# - **blah**
# - Item 3
#
# Required: false
# Default: test

inputB:
# This is a
# multiline description
#
# Required: false
# Default: test
```
<!-- action-docs-usage action="__tests__/fixtures/action/action.yml" project="npalm/action-docs" version="v1" -->
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
name: 'An Action'
description: 'Default test'
author: 'Niek Palm'
inputs:
inputA:
description: 'A description A'
required: false
inputB:
description: 'A description B'
required: true
inputC:
description: 'A description C'
required: true
default: C
inputD:
description: 'A description D'
required: false
default: D
inputE:
description: 'A description E'
required: false
default: false
outputs:
outputA:
description: 'A description A'
outputB:
description: 'A description B'
runs:
using: 'node12'
main: 'dist/index.js'
name: 'An Action'
description: 'Default test'
author: 'Niek Palm'
inputs:
inputA:
description: 'A description A'
required: false
inputB:
description: 'A description B'
required: true
inputC:
description: 'A description C'
required: true
default: C
inputD:
description: 'A description D'
required: false
default: D
inputE:
description: 'A description E'
required: false
default: false

outputs:
outputA:
description: 'A description A'
outputB:
description: 'A description B'

runs:
using: 'node12'
main: 'dist/index.js'
9 changes: 9 additions & 0 deletions __tests__/fixtures/action/all_fields_readme.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- action-docs-description action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-usage action="__tests__/fixtures/action/all_fields_action.yml" project="npalm/action-docs" version="v1" -->

<!-- action-docs-inputs action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-runs action="__tests__/fixtures/action/all_fields_action.yml" -->
7 changes: 7 additions & 0 deletions __tests__/fixtures/action/all_fields_readme.input.crlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- action-docs-description action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->

<!-- action-docs-inputs action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->

<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->

<!-- action-docs-runs action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->
70 changes: 70 additions & 0 deletions __tests__/fixtures/action/all_fields_readme.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!-- action-docs-description action="__tests__/fixtures/action/all_fields_action.yml" -->
## Description

Default test
<!-- action-docs-description action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-usage action="__tests__/fixtures/action/all_fields_action.yml" project="npalm/action-docs" version="v1" -->
## Usage

```yaml
- uses: npalm/action-docs@v1
with:
inputA:
# A description A
#
# Required: false
# Default: ""

inputB:
# A description B
#
# Required: true
# Default: ""

inputC:
# A description C
#
# Required: true
# Default: C

inputD:
# A description D
#
# Required: false
# Default: D

inputE:
# A description E
#
# Required: false
# Default: false
```
<!-- action-docs-usage action="__tests__/fixtures/action/all_fields_action.yml" project="npalm/action-docs" version="v1" -->

<!-- action-docs-inputs action="__tests__/fixtures/action/all_fields_action.yml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `inputA` | <p>A description A</p> | `false` | `""` |
| `inputB` | <p>A description B</p> | `true` | `""` |
| `inputC` | <p>A description C</p> | `true` | `C` |
| `inputD` | <p>A description D</p> | `false` | `D` |
| `inputE` | <p>A description E</p> | `false` | `false` |
<!-- action-docs-inputs action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml" -->
## Outputs

| name | description |
| --- | --- |
| `outputA` | <p>A description A</p> |
| `outputB` | <p>A description B</p> |
<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-runs action="__tests__/fixtures/action/all_fields_action.yml" -->
## Runs

This action is a `node12` action.
<!-- action-docs-runs action="__tests__/fixtures/action/all_fields_action.yml" -->
32 changes: 32 additions & 0 deletions __tests__/fixtures/action/all_fields_readme.output.crlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- action-docs-description action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->
## Description

Default test
<!-- action-docs-description action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->

<!-- action-docs-inputs action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `inputA` | <p>A description A</p> | `false` | `""` |
| `inputB` | <p>A description B</p> | `true` | `""` |
| `inputC` | <p>A description C</p> | `true` | `C` |
| `inputD` | <p>A description D</p> | `false` | `D` |
| `inputE` | <p>A description E</p> | `false` | `false` |
<!-- action-docs-inputs action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->

<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->
## Outputs

| name | description |
| --- | --- |
| `outputA` | <p>A description A</p> |
| `outputB` | <p>A description B</p> |
<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->

<!-- action-docs-runs action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->
## Runs

This action is a `node12` action.
<!-- action-docs-runs action="__tests__/fixtures/action/all_fields_action.yml.crlf" -->
42 changes: 42 additions & 0 deletions __tests__/fixtures/action/all_fields_readme_filled.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!-- action-docs-description action="__tests__/fixtures/action/all_fields_action.yml" -->
## Description

Default test


<!-- action-docs-description action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-inputs action="__tests__/fixtures/action/all_fields_action.yml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `inputA` | <p>A description A</p> | `false` | `""` |
| `inputB` | <p>A description B</p> | `true` | `""` |
| `inputC` | <p>A description C</p> | `true` | `C` |
| `inputD` | <p>A description D</p> | `false` | `D` |
| `inputE` | <p>A description E</p> | `false` | `false` |



<!-- action-docs-inputs action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml" -->
## Outputs

| name | description |
| --- | --- |
| `outputA` | <p>A description A</p> |
| `outputB` | <p>A description B</p> |



<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-runs action="__tests__/fixtures/action/all_fields_action.yml" -->
## Run

This action is a `docker` action.


<!-- action-docs-runs action="__tests__/fixtures/action/all_fields_action.yml" -->
32 changes: 32 additions & 0 deletions __tests__/fixtures/action/all_fields_readme_filled.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- action-docs-description action="__tests__/fixtures/action/all_fields_action.yml" -->
## Description

Default test
<!-- action-docs-description action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-inputs action="__tests__/fixtures/action/all_fields_action.yml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `inputA` | <p>A description A</p> | `false` | `""` |
| `inputB` | <p>A description B</p> | `true` | `""` |
| `inputC` | <p>A description C</p> | `true` | `C` |
| `inputD` | <p>A description D</p> | `false` | `D` |
| `inputE` | <p>A description E</p> | `false` | `false` |
<!-- action-docs-inputs action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml" -->
## Outputs

| name | description |
| --- | --- |
| `outputA` | <p>A description A</p> |
| `outputB` | <p>A description B</p> |
<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml" -->

<!-- action-docs-runs action="__tests__/fixtures/action/all_fields_action.yml" -->
## Runs

This action is a `node12` action.
<!-- action-docs-runs action="__tests__/fixtures/action/all_fields_action.yml" -->
1 change: 1 addition & 0 deletions __tests__/fixtures/action/all_fields_usage_readme.input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- action-docs-usage action="__tests__/fixtures/action/all_fields_action.yml" project="npalm/action-docs" version="v1" -->
37 changes: 37 additions & 0 deletions __tests__/fixtures/action/all_fields_usage_readme.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- action-docs-usage action="__tests__/fixtures/action/all_fields_action.yml" project="npalm/action-docs" version="v1" -->
## Usage

```yaml
- uses: npalm/action-docs@v1
with:
inputA:
# A description A
#
# Required: false
# Default: ""

inputB:
# A description B
#
# Required: true
# Default: ""

inputC:
# A description C
#
# Required: true
# Default: C

inputD:
# A description D
#
# Required: false
# Default: D

inputE:
# A description E
#
# Required: false
# Default: false
```
<!-- action-docs-usage action="__tests__/fixtures/action/all_fields_action.yml" project="npalm/action-docs" version="v1" -->
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions __tests__/fixtures/action/two_actions_readme.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- action-docs-inputs action="__tests__/fixtures/action/action_docs_action_action.yml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `readme` | <p>Readme file to update.</p> | `false` | `README.md` |
| `actionFile` | <p>The action definition file.</p> | `false` | `action.yml` |
| `tocLevel` | <p>TOC level used for the headers.</p> | `false` | `2` |
| `lineBreaks` | <p>Line breaks to be used in updated readme (LF|CR|CRLF).</p> | `false` | `LF` |
<!-- action-docs-inputs action="__tests__/fixtures/action/action_docs_action_action.yml" -->

<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml" -->
19 changes: 19 additions & 0 deletions __tests__/fixtures/action/two_actions_readme.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- action-docs-inputs action="__tests__/fixtures/action/action_docs_action_action.yml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `readme` | <p>Readme file to update.</p> | `false` | `README.md` |
| `actionFile` | <p>The action definition file.</p> | `false` | `action.yml` |
| `tocLevel` | <p>TOC level used for the headers.</p> | `false` | `2` |
| `lineBreaks` | <p>Line breaks to be used in updated readme (LF|CR|CRLF).</p> | `false` | `LF` |
<!-- action-docs-inputs action="__tests__/fixtures/action/action_docs_action_action.yml" -->

<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml" -->
## Outputs

| name | description |
| --- | --- |
| `outputA` | <p>A description A</p> |
| `outputB` | <p>A description B</p> |
<!-- action-docs-outputs action="__tests__/fixtures/action/all_fields_action.yml" -->
Loading

0 comments on commit 36dc07a

Please sign in to comment.