-
Notifications
You must be signed in to change notification settings - Fork 32
53 lines (46 loc) · 1.95 KB
/
cfn-test.yaml
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
name: Test CloudFormation Templates
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
name: checkov-action
strategy:
# Disable fast-fail to allow all template file tests to finish even if one fails
# Prevents needing to re-run tests to find errors in other template files
fail-fast: false
matrix:
# matrix.template_files is a list of template files to test
template_files:
- ./cost/aws/FlexeraReadOnlyPolicy.template
- ./tools/cloudformation-template/FlexeraAutomationPolicies.template
# TODO: Fix wildcard/dynamic release list
# - ./tools/cloudformation-template/releases/*.template
# Staticly define release templates for now
- ./tools/cloudformation-template/releases/FlexeraAutomationPolicies_v0.1.0.template
- ./tools/cloudformation-template/releases/FlexeraAutomationPolicies_v0.1.1.template
- ./tools/cloudformation-template/releases/FlexeraAutomationPolicies_v0.2.0.template
- ./tools/cloudformation-template/releases/FlexeraAutomationPolicies_v0.2.1.template
- ./tools/cloudformation-template/releases/FlexeraAutomationPolicies_v0.3.0.template
- ./tools/cloudformation-template/releases/FlexeraAutomationPolicies_v0.4.0.template
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Cloud Formation Linter with Latest Version
uses: scottbrenner/cfn-lint-action@v2
- name: Run Cloudformation Linter
id: cfn-lint
run: |
cfn-lint -t ${{ matrix.template_files }}
- name: Run Checkov action
id: checkov
uses: bridgecrewio/checkov-action@master
with:
file: ${{ matrix.template_files }}
quiet: true # optional: display only failed checks
framework: cloudformation # optional: run only on a specific infrastructure