-
Notifications
You must be signed in to change notification settings - Fork 25
46 lines (42 loc) · 1.31 KB
/
build.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
name: Build Artifacts
on:
push:
branches:
- main
env:
VERSION: "1.0.2"
jobs:
testRules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run guard rules tests
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/aws-cloudformation/cloudformation-guard/main/install-guard.sh | sh
export PATH=${PATH}:~/.guard/bin
cfn-guard test -d ./rules/
## If test fails run step to pull out only failed tests
- name: Display Failed Rules Only
if: ${{ failure() }}
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/aws-cloudformation/cloudformation-guard/main/install-guard.sh | sh
export PATH=${PATH}:~/.guard/bin
cfn-guard test -d ./rules/ | grep "FAIL Rules:" -B 2 -A 1
buildRuleSet:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
- run: |
chmod +x ./mappings/build.py
python3 ./mappings/build.py -r $VERSION
shell: bash
- uses: actions/upload-artifact@v3
with:
name: ruleset-build
path: |
docker/output/
mappings/rule_set_guard_rules_registry_all_rules.json
if-no-files-found: error