Skip to content

Commit

Permalink
Merge pull request #20 from LeonLuttenberger/chore/lint-one-click-tem…
Browse files Browse the repository at this point in the history
…plate

chore: Add validation step for one-click template
  • Loading branch information
kukushking authored Mar 2, 2024
2 parents 299ed1f + dc79f75 commit 3f8716b
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 11 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/module-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@ name: Module Checks

on:
push:
branches: ["main"]
paths: ['modules/**', '.github/workflows/module-checks.yml']
branches:
- "main"
paths:
- "modules/**"
- "requirements-dev.txt"
- ".github/workflows/module-checks.yml"

pull_request:
branches: ["main", "release/*", "stable"]
paths: ['modules/**', '.github/workflows/module-checks.yml']

workflow_dispatch:
branches:
- "main"
- "release/*"
- "stable"
paths:
- "modules/**"
- "requirements-dev.txt"
- ".github/workflows/module-checks.yml"

jobs:
get-modules:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/one-click-template-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check One-Click Launch Template

on:
push:
branches:
- "main"
paths:
- "one-click-launch.yaml"
- "requirements-dev.txt"
- ".github/workflows/one-click-template-lint.yml"

pull_request:
branches:
- "main"
- "release/*"
- "stable"
paths:
- "one-click-launch.yaml"
- "requirements-dev.txt"
- ".github/workflows/one-click-template-lint.yml"

jobs:
lint:
name: CFN Lint Template
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Requirements
run: |
set -x
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Lint
run: cfn-lint --template ./one-click-launch.yaml
6 changes: 3 additions & 3 deletions one-click-launch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ Resources:
Resource:
- !Sub "arn:aws:s3:::codeseeder-mlops-${AWS::AccountId}-*"
- !Sub "arn:aws:s3:::codeseeder-mlops-${AWS::AccountId}-*/*"
- !Sub "arn:aws:s3:::mlops*"
- !Sub "arn:aws:s3:::mlops*/*"
- "arn:aws:s3:::mlops*"
- "arn:aws:s3:::mlops*/*"
- Sid: CodebuildCleanup
Effect: Allow
Action:
Expand All @@ -240,7 +240,7 @@ Resources:
Description: Builds MLOps Solution Using Seedfarmer
ServiceRole: !GetAtt 'CodeBuildRole.Arn'
Artifacts:
Type: no_artifacts
Type: NO_ARTIFACTS
TimeoutInMinutes: 480
Environment:
Type: LINUX_CONTAINER
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pylint~=2.14.1
mypy~=0.961
pip-tools~=6.6.2
python-dotenv~=0.21.0
cfn-lint~=0.61.0
cfn-lint~=0.85.3
check-manifest~=0.48
pydot~=1.4.2
pyroma~=4.0
Expand All @@ -17,4 +17,4 @@ types-PyYAML~=6.0.8
types-setuptools~=57.4.17
wheel~=0.37.1
cdk-nag==2.12.29
click==8.0.2
click==8.0.2

0 comments on commit 3f8716b

Please sign in to comment.