-
Notifications
You must be signed in to change notification settings - Fork 27
119 lines (98 loc) · 3.58 KB
/
ci.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Build and Scan for Vulnerabilities
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
path: ./vams
- name: Setup Python Version
uses: actions/setup-python@v2
with:
python-version: 3.10.11
- name: Setup node for the whole package
uses: actions/setup-node@v3
- name: Clone automated security helper
uses: actions/checkout@v3
with:
repository: aws-samples/automated-security-helper
path: ./ash
- name: Run automated security helper
run: |
cd ash
export PATH=$PATH:./
ash --source-dir ../vams || true
- name: Upload Report
uses: actions/upload-artifact@v3
with:
name: automated-security-helper-report
path: ash/aggregated_results.txt
- name: Npm install root directory
working-directory: vams
run: npm install
- name: Npm audit root directory
working-directory: vams
run: npm audit --production
- name: Prettier Check
working-directory: vams
run: npm run prettier-check
- name: Install Poetry Action
uses: snok/install-poetry@v1
with:
version: 1.8.2
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: backend/.venv
installer-parallel: true
- name: Run yarn install web directory
uses: Borales/[email protected]
with:
dir: "vams/web"
cmd: install
- name: Run yarn audit web directory
uses: Borales/[email protected]
with:
dir: "vams/web"
cmd: audit
# - name: Web test
# working-directory: vams/web
# env:
# CI: "true"
# run: npm run test
- name: Web build
working-directory: vams/web
env:
CI: ""
run: npm run build.lowmem
- name: Npm install infrastructure directory
working-directory: vams/infra
run: npm install
- name: Npm audit infrastructure directory
working-directory: vams/infra
run: npm audit --production
- name: Synthesize Cloudformation templates
working-directory: vams/infra
run: |
CDK_NAG_ENABLED=true
export REGION=us-east-1
npx cdk synth
- name: eslint
working-directory: vams
run: npm run lint
- name: Scan VAMS WAF Cloudformation template
uses: stelligent/cfn_nag@master
with:
input_path: vams/infra/cdk.out/vams-waf-prod-us-east-1.template.json
- name: Scan VAMS Cloudformation template
uses: stelligent/cfn_nag@master
with:
input_path: vams/infra/cdk.out/vams-core-prod-us-east-1.template.json
- name: run checks
working-directory: vams/backend
run: make all