Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
beiertu-mms committed Jan 8, 2024
1 parent a086178 commit 2e3dd6e
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
82 changes: 81 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,84 @@
# Container Structure Test Action

An action to setup and run the [container-structure-test](https://github.com/GoogleContainerTools/container-structure-test) executable.
An action to setup, cache and run the [GoogleContainerTools/container-structure-test](https://github.com/GoogleContainerTools/container-structure-test) executable.

[actions/cache](https://github.com/actions/cache) is used to cache the executable under `<OS name>-container-structure-test`.

The cache should be deleted if the executable should be re-installed.

> [!NOTE]
> Currently this action only supports Linux and macOS GitHub runners.
## Usage

```yaml
- uses: actungs/container-structure-test-action@v1
with:
# The full docker image tag to be verified.
#
# Required.
image: ''

# The path to the container structure configuration files.
#
# Required.
config_files: ''

# The version of container-structure-test to be installed.
# See the key property in https://storage.googleapis.com/container-structure-test for available versions.
#
# Default: 'latest'
version: ''

# The path to where the executable will be installed to.
#
# Default: '.bin'
install_path: ''

# Set to 'false' if color should be used in the output.
#
# Default: 'true'
no_color: ''

# Set to 'true' to force a pull of the image before running the tests.
#
# Default: 'false'
pull_image: ''

# The output format for the test report. Available format: text, json, junit.
#
# Default: 'text'
output_format: ''

# Write the test report to the specified file. Supported file types are json and junit.
# Set the `output_format` accordingly.
# If the `output_format` does not match the given file type, then `json` will be used instead.
#
# Default: ''
report_file: ''
```

## Example

A simplified example, on how this action can be utilized, could look like this.

```yaml
"on": [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
# Build the container image
# ...
# Run the container test, assuming the image is 'actungs/test-image:local' and the configuration file is 'config.yaml'.
- uses: actungs/container-structure-test-action@v1
with:
image: actungs/test-image:local
config_files: config.yaml
```

## License

This project is released under the [MIT License](./LICENSE).

10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ inputs:
The path to where the executable will be installed to.
required: false
default: ".bin"
no_color:
description: |
No color in the output.
required: false
default: "true"
pull_image:
description: |
Whether the image should be pulled instead.
required: false
default: "false"
output_format:
description: |
The output format for the test report.
Expand Down

0 comments on commit 2e3dd6e

Please sign in to comment.