Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request tmknom#17 from tmknom/add-config-for-github-actions
Browse files Browse the repository at this point in the history
Add config for GitHub Actions
  • Loading branch information
tmknom authored May 3, 2020
2 parents 10c5dba + fd8ca41 commit 839a7d0
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/json.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: JSON
on:
pull_request:

jobs:
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/[email protected]
- name: Prettier
run: docker run --rm -v ${PWD}:/work tmknom/prettier --list-different --parser=json '**/*.json'
24 changes: 24 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Markdown
on:
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/[email protected]
- name: markdownlint
run: docker run --rm -i -v ${PWD}:/work tmknom/markdownlint

format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/[email protected]
- name: Prettier
run: docker run --rm -v ${PWD}:/work tmknom/prettier --list-different --parser=markdown '**/*.md'
66 changes: 66 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Terraform
on:
pull_request:

env:
TERRAFORM_VERSION: 0.12.24
AWS_DEFAULT_REGION: us-east-1

jobs:
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/[email protected]
- name: Format all
uses: hashicorp/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tf_actions_version: ${{ env.TERRAFORM_VERSION }}
tf_actions_comment: true
tf_actions_subcommand: fmt

validate:
name: Validate
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
dir:
- .
- examples/minimal
- examples/complete
steps:
- name: Checkout
uses: actions/[email protected]
- name: Init
uses: hashicorp/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tf_actions_version: ${{ env.TERRAFORM_VERSION }}
tf_actions_working_dir: ${{ matrix.dir }}
tf_actions_comment: true
tf_actions_subcommand: init
- name: Validate
uses: hashicorp/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tf_actions_version: ${{ env.TERRAFORM_VERSION }}
tf_actions_working_dir: ${{ matrix.dir }}
tf_actions_comment: true
tf_actions_subcommand: validate

lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/[email protected]
- name: TFLint
run: docker run --rm -v ${PWD}:/data wata727/tflint
24 changes: 24 additions & 0 deletions .github/workflows/yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: YAML
on:
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/[email protected]
- name: yamllint
run: docker run --rm -v ${PWD}:/work tmknom/yamllint --strict .

format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/[email protected]
- name: Prettier
run: docker run --rm -v ${PWD}:/work tmknom/prettier --list-different --parser=yaml '**/*.y*ml'

0 comments on commit 839a7d0

Please sign in to comment.