generated from terraform-yacloud-modules/terraform-yandex-module-template
-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (98 loc) · 2.49 KB
/
pipeline.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
92
93
94
95
96
97
98
99
100
101
name: 'Terraform'
on:
push:
branches:
- main
pull_request:
env:
tf_version: 1.3.9
tflint_version: v0.45.0
concurrency:
group: ci-pipeline-${{ github.workflow }}-${{ github.event.pull_request.number || github.event.pull_request.head.ref || github.ref }}
jobs:
linters:
name: 'Terraform Linters'
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
steps:
-
name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.tf_version }}
terraform_wrapper: false
-
name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
with:
tflint_version: ${{ env.tflint_version }}
-
name: Setup TFLint cache plugin dir
uses: actions/[email protected]
with:
path: ~/.tflint.d/plugins
key: tflint-${{ hashFiles('.tflint.hcl') }}
-
name: Test code with terraform fmt
run: terraform fmt --recursive -check=true --diff
continue-on-error: true
-
name: Test code with TFLint
continue-on-error: true
run: |
tflint --init
tflint -f compact
-
name: Test code with TFSec
continue-on-error: true
uses: aquasecurity/[email protected]
with:
soft_fail: true
-
name: Test code with Checkov
uses: bridgecrewio/[email protected]
with:
directory: /
framework: terraform
soft_fail: true
quiet: true
download_external_modules: false
semver:
name: 'Set code version tag'
runs-on: ubuntu-20.04
permissions:
contents: write
needs:
- linters
defaults:
run:
shell: bash
steps:
-
name: Check out code
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
-
name: Check out code
uses: actions/checkout@v4
if: github.event_name == 'push'
with:
fetch-depth: 0
-
name: Set application version
id: set_version
uses: kvendingoldo/[email protected]
with:
enable_github_releases: true
release_tag_prefix: "v"
github_token: "${{ secrets.GITHUB_TOKEN }}"