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