Skip to content

Commit 1fbe41c

Browse files
authored
Merge pull request #20 from mineiros-io/lukas/update-google-provider-to-v5
feat: add support for google v5 provider
2 parents 481ff12 + 1b457d7 commit 1fbe41c

18 files changed

+709
-885
lines changed

.github/workflows/preview.yml

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

.github/workflows/release.yml

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: terraform-google-storage-bucket-iam
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+
19+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup asdf
24+
# asdf-vm/actions/[email protected]
25+
uses: asdf-vm/actions/plugins-add@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
26+
27+
- name: Install tools via asdf
28+
run: asdf install
29+
30+
- name: Set up Golang
31+
32+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
33+
with:
34+
go-version: 1.22.0
35+
36+
- name: Set up Terradoc
37+
# for security reasons we pin commit ids and not tags.
38+
# mineiros-io/terradoc@main -> af1a7b3ae3635958adf5ee2f40e0c3e70fd0803a
39+
run: go install github.com/mineiros-io/terradoc/cmd/terradoc@af1a7b3ae3635958adf5ee2f40e0c3e70fd0803a
40+
env:
41+
GOPROXY: direct
42+
43+
- name: Cache plugin dir
44+
# for security reasons we pin commit ids and not tags.
45+
# actions/[email protected] -> 13aacd865c20de90d75de3b17ebe84f7a17d57d2
46+
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2
47+
with:
48+
path: ~/.tflint.d/plugins
49+
key: tflint-${{ hashFiles('.tflint.hcl') }}
50+
51+
- name: Init TFLint
52+
run: tflint --init
53+
env:
54+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
55+
GITHUB_TOKEN: ${{ github.token }}
56+
57+
- name: Setup and run pre-commit
58+
# for security reasons we pin commit ids and not tags.
59+
# pre-commit/[email protected] -> 2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
60+
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
61+
62+
unit-tests:
63+
# needs: pre-commit
64+
runs-on: ubuntu-latest
65+
name: Unit Tests
66+
steps:
67+
- name: Checkout
68+
69+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
70+
with:
71+
fetch-depth: 0
72+
73+
- name: Setup asdf
74+
# asdf-vm/actions/[email protected]
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+
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 }}
92+
93+
release:
94+
needs:
95+
- pre-commit
96+
- unit-tests
97+
permissions:
98+
contents: write
99+
issues: write
100+
runs-on: ubuntu-latest
101+
steps:
102+
- name: Checkout
103+
104+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
105+
with:
106+
fetch-depth: 0
107+
108+
- name: Semantic Release
109+
110+
uses: codfish/semantic-release-action@07170c8b1613177f0f3aa4d2224e2e0933cd732c
111+
id: semantic
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
with:
115+
plugins: |
116+
['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/github']

.github/workflows/tests.yml

-137
This file was deleted.

.gitignore

-1
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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/mineiros-io/pre-commit-hooks
3-
rev: v0.4.1
3+
rev: v0.5.1
44
hooks:
55
- id: phony-targets
66
- id: terradoc-validate
@@ -11,3 +11,8 @@ repos:
1111
- id: terraform-validate
1212
exclude: ^examples|.terraform/
1313
- id: tflint
14+
- repo: https://github.com/adrienverge/yamllint
15+
rev: v1.29.0
16+
hooks:
17+
- id: yamllint
18+
args: ['-s']

.releaserc

+13
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

+11
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@ rule "terraform_unused_declarations" {
55
rule "terraform_required_providers" {
66
enabled = false
77
}
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+
}

0 commit comments

Comments
 (0)