-
Notifications
You must be signed in to change notification settings - Fork 34
49 lines (43 loc) · 1.49 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
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:
- ./tools/cloudformation-template/FlexeraAutomationPolicies.template
- ./tools/cloudformation-template/FlexeraAutomationPoliciesSimple.template
- ./tools/cloudformation-template/rolling/FlexeraAutomationPolicies.template
- ./tools/cloudformation-template/rolling/FlexeraAutomationPoliciesReadOnly.template
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install cfn-lint
run: pip install cfn-lint
- 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