Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(prerelease): update usage of action-docs and main README.md #40

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .commitlintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
extends:
- "@open-turo/commitlint-config-conventional"
extends: ["@open-turo/commitlint-config-conventional"]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ See usage [here](./release/README.md#usage).

Documentation is found [here](./release/README.md).

### action: [`prerelease`](./prerelease)

Pre-release will perform the same steps as in the [`release`](./release) action but will run [GoReleaser](https://goreleaser.com/) to generate a [snapshot](https://goreleaser.com/customization/snapshots/?h=snapshot) release.

See usage [here](./prerelease/README.md#usage).

Documentation is found [here](./prerelease/README.md).

### action: [`test`](./test)

Executes golang unit tests that exist anywhere within the consumer repository and reports test results and coverage metrics as well. [action-setup-tools](https://github.com/open-turo/action-setup-tools) will be used to install golang, honoring the version information found in the `.go-version` file found in the root level of the consumer repository.
Expand Down
40 changes: 39 additions & 1 deletion integration-test/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
# GitHub Action Integration-Test

GitHub Action that conditionally executes integration tests via docker compose if the docker compose file is present.
<!-- prettier-ignore-start -->
<!-- action-docs-description source="integration-test/action.yaml" -->
## Description

Conditionally executes golang integration tests via docker, if docker compose file is found
<!-- action-docs-description source="integration-test/action.yaml" -->

<!-- action-docs-usage source="integration-test/action.yaml" -->
## Usage

```yaml
- uses: @
with:
checkout-repo:
# Perform checkout as first step of action
#
# Required: false
# Default: true

github-token:
# GitHub token for docker compose. e.g. 'secrets.GITHUB_TOKEN'.
#
# Required: true
# Default: ""

docker-compose-file:
# Relative or absolute path to docker-compose.yaml file
#
# Required: false
# Default: ./docker-compose.yaml

full-compose-output:
# Set this to true to log all container output from docker-compose
#
# Required: false
# Default: false
```
<!-- action-docs-usage source="integration-test/action.yaml" -->

## Usage

Expand All @@ -25,3 +62,4 @@ If the docker compose file is present, the action will run:
docker-compose up --build --exit-code-from test test
docker-compose down
```
<!-- prettier-ignore-end -->
27 changes: 22 additions & 5 deletions lint/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
# GitHub Action Lint

<!-- prettier-ignore-start -->
<!-- action-docs-description -->
<!-- action-docs-description source="lint/action.yaml" -->
## Description

GitHub Action that lints a Terraform based repository via [action-pre-commit](https://github.com/open-turo/action-pre-commit)
<!-- action-docs-description source="lint/action.yaml" -->
## Description

GitHub Action that lints a Terraform based repository via [action-pre-commit](https://github.com/open-turo/action-pre-commit)
<!-- action-docs-description -->
<!-- prettier-ignore-end -->

<!-- prettier-ignore-start -->
<!-- action-docs-inputs -->
<!-- action-docs-inputs source="lint/action.yaml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `checkout-repo` | <p>Perform checkout as first step of action</p> | `false` | `true` |
| `github-token` | <p>GitHub token that can checkout the consumer repository. e.g. 'secrets.GITHUB_TOKEN'</p> | `true` | `""` |
<!-- action-docs-inputs source="lint/action.yaml" -->
## Inputs

| parameter | description | required | default |
Expand All @@ -18,16 +29,22 @@ GitHub Action that lints a Terraform based repository via [action-pre-commit](ht
| github-token | GitHub token that can checkout the consumer repository. e.g. 'secrets.GITHUB_TOKEN' | `true` | |
<!-- action-docs-inputs -->

<!-- action-docs-outputs -->
<!-- action-docs-outputs source="lint/action.yaml" -->

<!-- action-docs-outputs source="lint/action.yaml" -->

<!-- action-docs-outputs -->

<!-- action-docs-runs -->
<!-- action-docs-runs source="lint/action.yaml" -->
## Runs

This action is a `composite` action.
<!-- action-docs-runs source="lint/action.yaml" -->
## Runs

This action is a `composite` action.
<!-- action-docs-runs -->

<!-- action-docs-usage -->
<!-- action-docs-usage source="lint/action.yaml" -->
<!-- action-docs-usage -->
<!-- prettier-ignore-end -->
58 changes: 45 additions & 13 deletions prerelease/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,70 @@
# GitHub Action Release
# GitHub Action Pre-release

<!-- prettier-ignore-start -->
<!-- action-docs-description -->
<!-- action-docs-description source="prerelease/action.yaml" -->
## Description

GitHub Action that produces a new pre-release (snapshot) of a golang based repository.
<!-- action-docs-description -->
<!-- action-docs-description source="prerelease/action.yaml" -->
<!-- prettier-ignore-end -->

<!-- prettier-ignore-start -->
<!-- action-docs-inputs -->
<!-- action-docs-inputs source="prerelease/action.yaml" -->
## Inputs

| parameter | description | required | default |
| name | description | required | default |
| --- | --- | --- | --- |
| checkout-repo | Perform checkout as first step of action | `false` | true |
| github-token | GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN' | `true` | |
| go-version | Go version to use for building | `true` | 1.17.3 |
<!-- action-docs-inputs -->
| `checkout-repo` | <p>Perform checkout as first step of action</p> | `false` | `true` |
| `github-token` | <p>GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN'</p> | `true` | `""` |
| `go-version` | <p>Go version to use for building</p> | `true` | `1.17.3` |
| `push-docker-snapshot` | <p>If a docker snapshot image is generated, push it to the to the registry</p> | `false` | `false` |
| `docker-username` | <p>Docker username to push the snapshot image to the registry</p> | `false` | `""` |
| `docker-password` | <p>Docker password to push the snapshot image to the registry</p> | `false` | `""` |
<!-- action-docs-inputs source="prerelease/action.yaml" -->

<!-- action-docs-outputs -->
<!-- action-docs-outputs source="prerelease/action.yaml" -->
## Outputs

| name | description |
| --- | --- |
| `version` | <p>Version of the project</p> |
<!-- action-docs-outputs source="prerelease/action.yaml" -->
## Outputs

| parameter | description |
| --- | --- |
| version | Version of the project |
<!-- action-docs-outputs -->

<!-- action-docs-runs -->
<!-- action-docs-runs source="prerelease/action.yaml -->
## Runs

This action is a `composite` action.
<!-- action-docs-runs -->

<!-- action-docs-usage -->
<!-- action-docs-usage -->
## Usage

```yaml
name: Prerelease

on:
pull_request:
types:
- opened
- labeled
- synchronize

jobs:
prerelease:
name: Build and push pre-release image
if: contains(github.event.pull_request.labels.*.name, 'prerelease')
steps:
- name: Pre-release
uses: open-turo/actions-go/prerelease@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-docker-snapshot: true
docker-username: ${{ secrets.DOCKER_USERNAME }}
docker-password: ${{ secrets.DOCKER_PASSWORD }}
```
<!-- prettier-ignore-end -->
56 changes: 51 additions & 5 deletions release/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
# GitHub Action Release

<!-- prettier-ignore-start -->
<!-- action-docs-description -->
<!-- action-docs-description source="release/action.yaml" -->
## Description

GitHub Action that produces a new Release of a golang based repository.
<!-- action-docs-description source="release/action.yaml" -->
## Description

GitHub Action that produces a new Release of a golang based repository.
<!-- action-docs-description -->
<!-- prettier-ignore-end -->

<!-- prettier-ignore-start -->
<!-- action-docs-inputs -->
<!-- action-docs-inputs source="release/action.yaml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `checkout-repo` | <p>Perform checkout as first step of action</p> | `false` | `true` |
| `github-token` | <p>GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN'</p> | `true` | `""` |
| `go-version` | <p>Go version to use for building</p> | `true` | `1.17.3` |
<!-- action-docs-inputs source="release/action.yaml" -->
## Inputs

| parameter | description | required | default |
Expand All @@ -19,20 +31,54 @@ GitHub Action that produces a new Release of a golang based repository.
| go-version | Go version to use for building | `true` | 1.17.3 |
<!-- action-docs-inputs -->

<!-- action-docs-outputs -->
<!-- action-docs-outputs source="release/action.yaml" -->
## Outputs

| name | description |
| --- | --- |
| `version` | <p>Version of the project</p> |
<!-- action-docs-outputs source="release/action.yaml" -->
## Outputs

| parameter | description |
| --- | --- |
| version | Version of the project |
<!-- action-docs-outputs -->

<!-- action-docs-runs -->
<!-- action-docs-runs source="release/action.yaml" -->
## Runs

This action is a `composite` action.
<!-- action-docs-runs source="release/action.yaml" -->
## Runs

This action is a `composite` action.
<!-- action-docs-runs -->

<!-- action-docs-usage -->
<!-- action-docs-usage source="release/action.yaml" -->
## Usage

```yaml
- uses: @
with:
checkout-repo:
# Perform checkout as first step of action
#
# Required: false
# Default: true

github-token:
# GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN'
#
# Required: true
# Default: ""

go-version:
# Go version to use for building
#
# Required: true
# Default: 1.17.3
```
<!-- action-docs-usage source="release/action.yaml" -->
<!-- action-docs-usage -->
<!-- prettier-ignore-end -->
4 changes: 2 additions & 2 deletions script/update-action-readme
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ for i in $*; do
continue
fi
readme_file=$(dirname "$i")/README.md
echo "npx action-docs --no-banner -a "${i}" --update-readme "${readme_file}""
npx action-docs --no-banner -a "${i}" --update-readme "${readme_file}"
echo "npx action-docs --no-banner --source "${i}" --update-readme "${readme_file}""
npx action-docs --no-banner --source "${i}" --update-readme "${readme_file}"
done
46 changes: 40 additions & 6 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,67 @@
# GitHub Action Test

<!-- prettier-ignore-start -->
<!-- action-docs-description -->
<!-- action-docs-description source="test/action.yaml" -->
## Description

GitHub Action that executes unit tests present anywhere within a golang based GitHub repository and reports results including coverage metrics
<!-- action-docs-description source="test/action.yaml" -->
## Description

GitHub Action that executes unit tests present anywhere within a golang based GitHub repository and reports results including coverage metrics
<!-- action-docs-description -->
<!-- prettier-ignore-end -->

<!-- prettier-ignore-start -->
<!-- action-docs-inputs -->
<!-- action-docs-inputs source="test/action.yaml" -->
## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `checkout-repo` | <p>Perform checkout as first step of action</p> | `false` | `true` |
| `github-token` | <p>GitHub token that can checkout the consumer repository. e.g. 'secrets.GITHUB_TOKEN'</p> | `true` | `""` |
<!-- action-docs-inputs source="test/action.yaml" -->
## Inputs

| parameter | description | required | default |
| --- | --- | --- | --- |
| checkout-repo | Perform checkout as first step of action | `false` | true |
| github-token | GitHub token that can checkout the consumer repository. e.g. 'secrets.GITHUB_TOKEN' | `true` | |
<!-- action-docs-inputs -->

<!-- action-docs-outputs -->
<!-- action-docs-outputs source="test/action.yaml" -->

<!-- action-docs-outputs source="test/action.yaml" -->

<!-- action-docs-outputs -->

<!-- action-docs-runs -->
<!-- action-docs-runs source="test/action.yaml" -->
## Runs

This action is a `composite` action.
<!-- action-docs-runs source="test/action.yaml" -->
## Runs

This action is a `composite` action.
<!-- action-docs-runs -->

<!-- action-docs-usage -->
<!-- action-docs-usage source="test/action.yaml" -->
## Usage

```yaml
- uses: @
with:
checkout-repo:
# Perform checkout as first step of action
#
# Required: false
# Default: true

github-token:
# GitHub token that can checkout the consumer repository. e.g. 'secrets.GITHUB_TOKEN'
#
# Required: true
# Default: ""
```
<!-- action-docs-usage source="test/action.yaml" -->
<!-- action-docs-usage -->
<!-- prettier-ignore-end -->
Loading