Skip to content

Commit

Permalink
fix(docs): improvements for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
dgschwindturo committed Mar 30, 2022
1 parent 1830db9 commit 3693a0a
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 55 deletions.
27 changes: 11 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![semantic-release][semantic-image]][semantic-url]
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)

GitHub Actions for `golang` repositories
GitHub Actions for `golang` based repositories

## Actions

Expand All @@ -18,12 +18,11 @@ GitHub Actions for `golang` repositories
jobs:
build:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Action Lint
- name: Lint
uses: open-turo/actions-go/lint@v1
with:
## example value for github-token provided below
github-token: ${{ secrets.GITHUB_TOKEN }}
```
### action: [`release`](./release)
Expand All @@ -32,16 +31,11 @@ jobs:
jobs:
build:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Action Semantic Release
- name: Release
uses: open-turo/actions-go/release@v1
with:
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## example value for github-token provided below
github-token: ${{ secrets.GITHUB_TOKEN }}
```

### action: [`test`](./test)
Expand All @@ -50,10 +44,11 @@ jobs:
jobs:
test:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Test
uses: open-turo/actions-go/test@v1
with:
## example value for github-token provided below
github-token: ${{ secrets.GITHUB_TOKEN }}
```

<!-- Links: -->
Expand Down
9 changes: 5 additions & 4 deletions integration-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ GitHub Action that conditionally executes integration tests via docker compose i
```yaml
jobs:
integration-test:
name: Test / Integration
steps:
- name: Integration test
uses: open-turo/actions-go/integration-test@v1
- uses: open-turo/actions-go/integration-test@v1
with:
github-token: ...
## example value for github-token provided below
github-token: ${{ secrets.GITHUB_TOKEN }}
```
Note: by default, this action will perform actions/checkout as its first step.
## Integration-Test
If the docker compose file is present, it will run:
If the docker compose file is present, the action will run:
```shell
docker-compose up --build --exit-code-from test test
Expand Down
8 changes: 4 additions & 4 deletions integration-test/action.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: "golang: Integration test"
description: "Conditionally executes golang integration tests via docker, if docker compose file is found"
description: Conditionally executes golang integration tests via docker, if docker compose file is found
inputs:
checkout-repo:
required: false
description: "Perform checkout as first step of action"
description: Perform checkout as first step of action
default: "true"
github-token:
required: true
description: "GitHub token for docker compose. e.g. 'secrets.GITHUB_TOKEN'."
description: GitHub token for docker compose. e.g. 'secrets.GITHUB_TOKEN'.
docker-compose-file:
required: false
description: "Relative or absolute path to docker-compose.yaml file"
description: Relative or absolute path to docker-compose.yaml file
default: ./docker-compose.yaml
runs:
using: composite
Expand Down
13 changes: 7 additions & 6 deletions lint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
steps:
- name: Action lint
uses: open-turo/actions-go/lint@v1
with:
## example value for github-token provided below
github-token: ${{ secrets.GITHUB_TOKEN }}
```
Note: by default, this action will perform actions/checkout as its first step.
Expand All @@ -18,14 +21,12 @@ Note: by default, this action will perform actions/checkout as its first step.
This action runs the following lint checks:
- [wagoid/commitlint-github-action](https://github.com/wagoid/commitlint-github-action)
- [pre-commit/action](https://github.com/pre-commit/action)
- [action-pre-commit](https://github.com/open-turo/action-pre-commit)
## Notes
- If the repository has a `package-lock.json`
- If the repository has a `package-lock.json`:
- It will execute `npm ci` before running the `pre-commit` step.
- It will run the `check-build` action.
- `actionlint` will be installed and in the path to ensure that https://github.com/rhysd/actionlint can be run directly.
- This expects that `.commitlintrc.yml` will be present to enforce [`conventional-commit`](https://github.com/wagoid/commitlint-github-action).
- `actionlint` must be installed and in the path to ensure that https://github.com/rhysd/actionlint can be run directly.
- This expects that `.commitlintrc.yaml` will be present to enforce [`conventional-commit`](https://github.com/wagoid/commitlint-github-action).
- Checkout must have history to ensure that commit message linting works.
10 changes: 5 additions & 5 deletions lint/action.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: "golang Lint"
description: "Lints golang repository"
name: "golang: Lint"
description: Lints golang repository
inputs:
checkout-repo:
required: false
description: "Perform checkout as first step of action"
description: Perform checkout as first step of action
default: "true"
github-token:
required: true
description: "GitHub token that can checkout the repository. e.g. 'secrets.GITHUB_TOKEN'"
description: GitHub token that can checkout the repository. e.g. 'secrets.GITHUB_TOKEN'
runs:
using: composite
steps:
Expand All @@ -17,8 +17,8 @@ runs:
with:
fetch-depth: 0
- name: Setup tools
uses: open-turo/action-setup-tools@v1
## Installs version of golang found in .go-version
uses: open-turo/action-setup-tools@v1
- name: Authorize
uses: open-turo/action-git-auth@v1
with:
Expand Down
10 changes: 3 additions & 7 deletions release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ steps:
- name: Action semantic release
uses: open-turo/actions-go/release@v1
with:
## example value for github-token provided below
github-token: ${{ secrets.GITHUB_TOKEN }}
```
Expand Down Expand Up @@ -48,16 +49,11 @@ If you are using this action for protected branches, replace `GITHUB_TOKEN` with
jobs:
build:
steps:
- uses: open-turo/actions-go/release@v1
id: release # Need an `id` for output variables
with:
fetch-depth: 0
- name: Semantic release
- name: Action release
uses: open-turo/actions-go/release@v1
id: semantic # Need an `id` for output variables
id: release # Need an `id` for output variables
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Do something when a new release published
if: steps.release.outputs.new-release-published == 'true'
run: |
Expand Down
14 changes: 7 additions & 7 deletions release/action.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: "Go Release & Publish"
description: "Publish a new release of the project"
name: "golang: Release & publish"
description: Publish a new release of the project
inputs:
checkout-repo:
required: false
description: "Perform checkout as first step of action"
description: Perform checkout as first step of action
default: "true"
github-token:
description: "GitHub token that can checkout the repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN'"
description: GitHub token that can checkout the repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN'
required: true
go-version:
description: "Go version to use for building"
description: Go version to use for building
required: true
default: 1.17.3
outputs:
version:
description: "Version of the project"
description: Version of the project
value: ${{ steps.release.outputs.version }}
runs:
using: "composite"
using: composite
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
7 changes: 5 additions & 2 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ jobs:
steps:
- name: Test
uses: open-turo/actions-go/test@v1
with:
## example value for github-token provided below
github-token: ${{ secrets.GITHUB_TOKEN }}
```
Note: by default, this action will perform actions/checkout as its first step.
## Test
It will run to detect and execute all unit tests in the top level of the
repository and all subdirectories.
The action will run to detect and execute all unit tests in the top level of the
repository and all subdirectories. Coverage metrics will be reported.
```shell
go test -cover ./...
Expand Down
8 changes: 4 additions & 4 deletions test/action.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: "golang: Test"
description: "Executes go unit tests within repository reporting test coverage metrics"
description: Executes go unit tests within repository reporting test coverage metrics
inputs:
checkout-repo:
required: false
description: "Perform checkout as first step of action"
description: Perform checkout as first step of action
default: "true"
github-token:
required: true
description: "GitHub token that can checkout the repository. e.g. 'secrets.GITHUB_TOKEN'"
description: GitHub token that can checkout the repository. e.g. 'secrets.GITHUB_TOKEN'
runs:
using: composite
steps:
Expand All @@ -17,8 +17,8 @@ runs:
with:
fetch-depth: 0
- name: Setup tools
uses: open-turo/action-setup-tools@v1
## Installs version of golang found in .go-version
uses: open-turo/action-setup-tools@v1
- name: Authorize
uses: open-turo/action-git-auth@v1
with:
Expand Down

0 comments on commit 3693a0a

Please sign in to comment.