Skip to content

Commit 2b76695

Browse files
committed
ci: add ci workflows
1 parent 383d570 commit 2b76695

File tree

4 files changed

+146
-0
lines changed

4 files changed

+146
-0
lines changed

.github/.dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Code
16+
# v6.0.0
17+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
18+
19+
- name: Bump Version
20+
id: tag_version
21+
# v6.2
22+
uses: mathieudutour/github-tag-action@d28fa2ccfbd16e871a4bdf35e11b3ad1bd56c0c1
23+
with:
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
default_bump: minor
26+
custom_release_rules: bug:patch:Fixes,chore:patch:Chores,docs:patch:Documentation,feat:minor:Features,refactor:minor:Refactors,test:patch:Tests,ci:patch:Development,dev:patch:Development
27+
28+
- name: Create Release
29+
# v1.20.0
30+
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b
31+
with:
32+
tag: ${{ steps.tag_version.outputs.new_tag }}
33+
name: ${{ steps.tag_version.outputs.new_tag }}
34+
body: ${{ steps.tag_version.outputs.changelog }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: semantic-check
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
- edited
7+
- synchronize
8+
9+
permissions:
10+
contents: read
11+
pull-requests: read
12+
13+
jobs:
14+
main:
15+
name: Semantic Commit Message Check
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Code
19+
# v6.0.0
20+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
21+
- name: Check PR for Semantic Commit Message
22+
# v6.1.1
23+
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
requireScope: false
28+
validateSingleCommit: true

.github/workflows/test.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
env:
14+
TF_IN_AUTOMATION: true
15+
16+
jobs:
17+
lint:
18+
name: lint
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
# v6.0.0
24+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
25+
26+
- name: setup terraform
27+
# v3.1.2
28+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
29+
30+
- name: Cache Terraform Plugins
31+
# v4.3.0
32+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
33+
with:
34+
path: ${{ runner.temp }}/.terraform.d/plugin-cache
35+
key: tf-plugins-${{ runner.os }}-${{ hashFiles('**/.terraform.lock.hcl') }}
36+
37+
- name: Initialize Terraform
38+
run: terraform init
39+
40+
- name: Suggest Terraform Format
41+
if: github.event_name == 'pull_request'
42+
# v1.24.0
43+
uses: reviewdog/action-suggester@fc4b06f8697e1e66bd66703f660005079be0b3dc
44+
with:
45+
tool_name: terraform-fmt
46+
level: warning
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
fail_level: error
49+
50+
- name: Check Terraform Format
51+
if: github.event_name == 'push'
52+
run: terraform fmt -recursive -check
53+
54+
- name: Validate Terraform
55+
# v1.16.1
56+
uses: reviewdog/action-terraform-validate@6f4d41dfe9cf0c095aec3d341110eadb4c90c360
57+
with:
58+
github_token: ${{ secrets.GITHUB_TOKEN }}
59+
reporter: github-pr-review
60+
level: warning
61+
fail_level: error
62+
63+
- name: Lint Terraform
64+
# v1.25.0
65+
uses: reviewdog/action-tflint@9cbfc0aeae4af75fb73e8d5b6efbcd82e9483532
66+
with:
67+
reporter: github-pr-review
68+
filter_mode: nofilter
69+
fail_level: error
70+
71+
- name: Lint GitHub Actions
72+
# v1.69.0
73+
uses: reviewdog/action-actionlint@2ca4336c1821eaff87db1f72fd3923b3250e0427
74+
with:
75+
reporter: github-pr-check
76+
fail_level: error
77+
filter_mode: nofilter
78+

0 commit comments

Comments
 (0)