Skip to content

Commit 839a7d0

Browse files
authored
Merge pull request tmknom#17 from tmknom/add-config-for-github-actions
Add config for GitHub Actions
2 parents 10c5dba + fd8ca41 commit 839a7d0

File tree

4 files changed

+128
-0
lines changed

4 files changed

+128
-0
lines changed

.github/workflows/json.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: JSON
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
format:
7+
name: Format
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 5
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
- name: Prettier
14+
run: docker run --rm -v ${PWD}:/work tmknom/prettier --list-different --parser=json '**/*.json'

.github/workflows/markdown.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Markdown
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 5
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
- name: markdownlint
14+
run: docker run --rm -i -v ${PWD}:/work tmknom/markdownlint
15+
16+
format:
17+
name: Format
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 5
20+
steps:
21+
- name: Checkout
22+
uses: actions/[email protected]
23+
- name: Prettier
24+
run: docker run --rm -v ${PWD}:/work tmknom/prettier --list-different --parser=markdown '**/*.md'

.github/workflows/terraform.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Terraform
2+
on:
3+
pull_request:
4+
5+
env:
6+
TERRAFORM_VERSION: 0.12.24
7+
AWS_DEFAULT_REGION: us-east-1
8+
9+
jobs:
10+
format:
11+
name: Format
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
steps:
15+
- name: Checkout
16+
uses: actions/[email protected]
17+
- name: Format all
18+
uses: hashicorp/[email protected]
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
with:
22+
tf_actions_version: ${{ env.TERRAFORM_VERSION }}
23+
tf_actions_comment: true
24+
tf_actions_subcommand: fmt
25+
26+
validate:
27+
name: Validate
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 5
30+
strategy:
31+
matrix:
32+
dir:
33+
- .
34+
- examples/minimal
35+
- examples/complete
36+
steps:
37+
- name: Checkout
38+
uses: actions/[email protected]
39+
- name: Init
40+
uses: hashicorp/[email protected]
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
tf_actions_version: ${{ env.TERRAFORM_VERSION }}
45+
tf_actions_working_dir: ${{ matrix.dir }}
46+
tf_actions_comment: true
47+
tf_actions_subcommand: init
48+
- name: Validate
49+
uses: hashicorp/[email protected]
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
tf_actions_version: ${{ env.TERRAFORM_VERSION }}
54+
tf_actions_working_dir: ${{ matrix.dir }}
55+
tf_actions_comment: true
56+
tf_actions_subcommand: validate
57+
58+
lint:
59+
name: Lint
60+
runs-on: ubuntu-latest
61+
timeout-minutes: 5
62+
steps:
63+
- name: Checkout
64+
uses: actions/[email protected]
65+
- name: TFLint
66+
run: docker run --rm -v ${PWD}:/data wata727/tflint

.github/workflows/yaml.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: YAML
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 5
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
- name: yamllint
14+
run: docker run --rm -v ${PWD}:/work tmknom/yamllint --strict .
15+
16+
format:
17+
name: Format
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 5
20+
steps:
21+
- name: Checkout
22+
uses: actions/[email protected]
23+
- name: Prettier
24+
run: docker run --rm -v ${PWD}:/work tmknom/prettier --list-different --parser=yaml '**/*.y*ml'

0 commit comments

Comments
 (0)