-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (57 loc) · 1.87 KB
/
lint.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
---
name: Lint
# yamllint disable rule:truthy
on: [push, workflow_dispatch]
# yamllint enable
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdk
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install AWS CDK Toolkit
run: |
npm install -g aws-cdk@"==2.21.1"
- name: Install requirements
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --no-deps \
-r ./requirements/base.txt \
-r ./requirements/dev.txt
id: req-installed
- name: Install cfn-lint
run: |
python -m venv ../.venv-cfnlint
. ../.venv-cfnlint/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install --no-deps -r ./requirements/cfn-lint.txt
deactivate
id: cfn-lint-installed
- name: Run black
run: |
python -m black --check .
if: ${{ !cancelled() && steps.req-installed.outcome == 'success' }}
- name: Run isort
run: |
python -m isort --check-only --diff .
if: ${{ !cancelled() && steps.req-installed.outcome == 'success' }}
- name: Synthesize CloudFormation templates
run: |
mkdir templates
cdk synth playground > templates/playground.yaml
id: synthesized
if: ${{ !cancelled() && steps.req-installed.outcome == 'success' }}
- name: Run cfn-lint
run: |
../.venv-cfnlint/bin/cfn-lint --info
if: ${{ !cancelled() && steps.cfn-lint-installed.outcome == 'success' && steps.synthesized.outcome == 'success' }}