-
Notifications
You must be signed in to change notification settings - Fork 147
43 lines (40 loc) · 1.07 KB
/
unit-tests.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
name: Unit Tests
on:
push:
branches:
- main
pull_request:
types:
- opened
- edited
- synchronize
jobs:
unit_tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Cache
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
# Setup
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10' # have to use quotes due to 0 being removed
- name: Install python packages
run: pip install -Ur requirements.txt
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
- name: Install Ruby gems
run: gem install cfn-nag
# Run Tests
- name: CloudFormation lint test
run: cfn-lint code/solutions/**/*.yaml --ignore-templates code/solutions/policy-as-code-with-guard/example_bucket_tests.yaml
- name: CloudFormation nag test
run: cfn_nag_scan --input-path code/solutions --ignore-fatal