Skip to content

Commit 47d0280

Browse files
authored
Merge pull request #9 from mineiros-io/lukas/upgrade-google-provider-to-v5
feat: add support for google v5 provider
2 parents acc72b3 + 8433319 commit 47d0280

30 files changed

Lines changed: 1717 additions & 806 deletions

.github/workflows/preview.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Preview
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: terraform-google-monitoring-notification-channel
8+
cancel-in-progress: false
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ubuntu-latest
13+
name: Static Analysis
14+
steps:
15+
- name: Checkout
16+
# for security reasons we pin commit ids and not tags.
17+
# actions/checkout@v3.0.2 -> 2541b1294d2704b0964813337f33b291d3f8596b
18+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup asdf
23+
# asdf-vm/actions/plugins-add@v3.0.2
24+
uses: asdf-vm/actions/plugins-add@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
25+
26+
- name: Install tools via asdf
27+
run: asdf install
28+
29+
- name: Set up Golang
30+
# actions/setup-go@v5.0.0
31+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
32+
with:
33+
go-version: 1.22.0
34+
35+
- name: Set up Terradoc
36+
# for security reasons we pin commit ids and not tags.
37+
# mineiros-io/terradoc@main -> af1a7b3ae3635958adf5ee2f40e0c3e70fd0803a
38+
run: go install github.com/mineiros-io/terradoc/cmd/terradoc@af1a7b3ae3635958adf5ee2f40e0c3e70fd0803a
39+
env:
40+
GOPROXY: direct
41+
42+
- name: Cache plugin dir
43+
# for security reasons we pin commit ids and not tags.
44+
# actions/cache@v4.0.0 -> 13aacd865c20de90d75de3b17ebe84f7a17d57d2
45+
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2
46+
with:
47+
path: ~/.tflint.d/plugins
48+
key: tflint-${{ hashFiles('.tflint.hcl') }}
49+
50+
- name: Init TFLint
51+
run: tflint --init
52+
env:
53+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
54+
GITHUB_TOKEN: ${{ github.token }}
55+
56+
- name: Setup and run pre-commit
57+
# for security reasons we pin commit ids and not tags.
58+
# pre-commit/action@v3.0.1 -> 2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
59+
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
60+
61+
unit-tests:
62+
# needs: pre-commit
63+
runs-on: ubuntu-latest
64+
name: Unit Tests
65+
steps:
66+
- name: Checkout
67+
# for security reasons we pin commit ids and not tags.
68+
# actions/checkout@v3.0.2 -> 2541b1294d2704b0964813337f33b291d3f8596b
69+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
70+
with:
71+
fetch-depth: 0
72+
73+
- name: Setup asdf
74+
# asdf-vm/actions/plugins-add@v3.0.2
75+
uses: asdf-vm/actions/plugins-add@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
76+
77+
- name: Install tools via asdf
78+
run: asdf install
79+
80+
- name: Set up Golang
81+
# actions/setup-go@v5.0.0
82+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
83+
with:
84+
go-version: 1.22.0
85+
86+
- name: Run Unit Tests
87+
run: make test/unit-tests
88+
env:
89+
GOOGLE_CREDENTIALS: ${{ secrets.MINEIROS_TESTING_GCP_SA_KEY_FILE }}
90+
TEST_GCP_PROJECT: ${{ secrets.MINEIROS_TESTING_GCP_PROJECT }}
91+
TEST_GCP_ORG_DOMAIN: ${{ secrets.MINEIROS_TESTING_GCP_ORG_DOMAIN }}

.github/workflows/release.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: terraform-google-monitoring-notification-channel
10+
cancel-in-progress: false
11+
12+
jobs:
13+
pre-commit:
14+
runs-on: ubuntu-latest
15+
name: Static Analysis
16+
steps:
17+
- name: Checkout
18+
# for security reasons we pin commit ids and not tags.
19+
# actions/checkout@v3.0.2 -> 2541b1294d2704b0964813337f33b291d3f8596b
20+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Setup asdf
25+
# asdf-vm/actions/plugins-add@v3.0.2
26+
uses: asdf-vm/actions/plugins-add@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
27+
28+
- name: Install tools via asdf
29+
run: asdf install
30+
31+
- name: Set up Golang
32+
# actions/setup-go@v5.0.0
33+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
34+
with:
35+
go-version: 1.22.0
36+
37+
- name: Set up Terradoc
38+
# for security reasons we pin commit ids and not tags.
39+
# mineiros-io/terradoc@main -> af1a7b3ae3635958adf5ee2f40e0c3e70fd0803a
40+
run: go install github.com/mineiros-io/terradoc/cmd/terradoc@af1a7b3ae3635958adf5ee2f40e0c3e70fd0803a
41+
env:
42+
GOPROXY: direct
43+
44+
- name: Cache plugin dir
45+
# for security reasons we pin commit ids and not tags.
46+
# actions/cache@v4.0.0 -> 13aacd865c20de90d75de3b17ebe84f7a17d57d2
47+
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2
48+
with:
49+
path: ~/.tflint.d/plugins
50+
key: tflint-${{ hashFiles('.tflint.hcl') }}
51+
52+
- name: Init TFLint
53+
run: tflint --init
54+
env:
55+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
56+
GITHUB_TOKEN: ${{ github.token }}
57+
58+
- name: Setup and run pre-commit
59+
# for security reasons we pin commit ids and not tags.
60+
# pre-commit/action@v3.0.1 -> 2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
61+
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
62+
63+
unit-tests:
64+
# needs: pre-commit
65+
runs-on: ubuntu-latest
66+
name: Unit Tests
67+
steps:
68+
- name: Checkout
69+
# for security reasons we pin commit ids and not tags.
70+
# actions/checkout@v3.0.2 -> 2541b1294d2704b0964813337f33b291d3f8596b
71+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
72+
with:
73+
fetch-depth: 0
74+
75+
- name: Setup asdf
76+
# asdf-vm/actions/plugins-add@v3.0.2
77+
uses: asdf-vm/actions/plugins-add@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
78+
79+
- name: Install tools via asdf
80+
run: asdf install
81+
82+
- name: Set up Golang
83+
# actions/setup-go@v5.0.0
84+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
85+
with:
86+
go-version: 1.22.0
87+
88+
- name: Run Unit Tests
89+
run: make test/unit-tests
90+
env:
91+
GOOGLE_CREDENTIALS: ${{ secrets.MINEIROS_TESTING_GCP_SA_KEY_FILE }}
92+
TEST_GCP_PROJECT: ${{ secrets.MINEIROS_TESTING_GCP_PROJECT }}
93+
TEST_GCP_ORG_DOMAIN: ${{ secrets.MINEIROS_TESTING_GCP_ORG_DOMAIN }}
94+
95+
release:
96+
needs:
97+
- pre-commit
98+
- unit-tests
99+
permissions:
100+
contents: write
101+
issues: write
102+
runs-on: ubuntu-latest
103+
steps:
104+
- name: Checkout
105+
# actions/checkout@v3.0.2
106+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
107+
with:
108+
fetch-depth: 0
109+
110+
- name: Semantic Release
111+
# codfish/semantic-release-action@v3.1.0
112+
uses: codfish/semantic-release-action@07170c8b1613177f0f3aa4d2224e2e0933cd732c
113+
id: semantic
114+
env:
115+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116+
with:
117+
plugins: |
118+
['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/github']

.github/workflows/tests.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,3 @@ vendor
5151
crash.log
5252

5353
.terraform.lock.hcl
54-
.tool-versions

.pre-commit-config.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
repos:
22
- repo: https://github.com/mineiros-io/pre-commit-hooks
3-
rev: v0.3.0
3+
rev: v0.5.1
44
hooks:
5+
- id: phony-targets
6+
- id: terradoc-validate
7+
- id: terradoc-fmt
8+
- id: terradoc-generate
9+
- id: terramate-generate
510
- id: terraform-fmt
611
- id: terraform-validate
712
exclude: ^examples|.terraform/
813
- id: tflint
9-
- id: golangci-lint
10-
- id: phony-targets
14+
- repo: https://github.com/adrienverge/yamllint
15+
rev: v1.29.0
16+
hooks:
17+
- id: yamllint
18+
args: ['-s']

.releaserc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
["@semantic-release/npm", {
7+
"npmPublish": false
8+
}],
9+
"@semantic-release/commit-analyzer",
10+
"@semantic-release/release-notes-generator",
11+
"@semantic-release/github"
12+
]
13+
}

.tflint.hcl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
rule "terraform_unused_declarations" {
2+
enabled = false
3+
}
4+
5+
rule "terraform_required_providers" {
6+
enabled = false
7+
}
8+
9+
plugin "terraform" {
10+
enabled = true
11+
preset = "recommended"
12+
}
13+
14+
plugin "google" {
15+
enabled = true
16+
version = "0.26.0"
17+
source = "github.com/terraform-linters/tflint-ruleset-google"
18+
}

.tool-versions

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
terraform 1.5.7
2+
terramate 0.4.5
3+
tflint 0.50.2
4+
pre-commit 3.6.1

.yamllint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extends: default
2+
rules:
3+
line-length: disable
4+
document-start: disable
5+
truthy: disable

0 commit comments

Comments
 (0)