Skip to content

Update linting and fix linting findigns #36

Update linting and fix linting findigns

Update linting and fix linting findigns #36

Workflow file for this run

---
# This is an a CI pipeline
name: main
# Controls when the workflow run
on:
push:
# Triggers the workflow for feature branches and main branch
branches:
- "feature/*"
- "main"
# Run build, linting, security and unit testing in parallel,
# and in the main branch only create a release
jobs:
# Build project.
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Warming
run: make warming
- name: Build
run: make build
# Linting check
Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Warming
run: make warming
- name: Linting
run: make linting
# Security check
Security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Warming
run: make warming
# Build AWS CDK output
- name: Build
run: make build
# We use a dedicated action for the security check
# https://github.com/stelligent/cfn_nag
- name: Security
uses: stelligent/cfn_nag@master
with:
input_path: ./cdk.out
extra_args: -t ..*\.template\.json
# https://github.com/stelligent/cfn_nag/issues/582
- name: Fail if cfn_nag scan contains failures
# sum cfn_nag failures and return it as exit code
run: |
exit `grep Failures cfn_nag.out | awk '{ SUM += $3} END { print SUM }'`
# Unit tests
UnitTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Warming
run: make warming
- name: Unit tests
run: make unittest
# Deployment example
Deploy:
# Move forward only on main branch
if: ${{ github.ref == 'refs/heads/main' }}
# Move forward only if all jobs above are successed
needs: [Build, Linting, Security, UnitTest]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Deploy
run: echo "Deploying placeholder"