Skip to content

Commit

Permalink
Merge pull request #2 from ScottGibb/1-add-yamllint-to-ci-pipeline
Browse files Browse the repository at this point in the history
Adding yamllint to project
  • Loading branch information
ScottGibb authored May 25, 2023
2 parents c488b2e + f15a3ff commit 0d80d32
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 51 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/Build.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

name: Build

on: [push]

Check warning on line 5 in .github/workflows/Build.yaml

View workflow job for this annotation

GitHub Actions / YAML Lint Check

5:1 [truthy] truthy value should be one of [false, true]
Expand All @@ -10,4 +12,4 @@ jobs:
- uses: actions/checkout@v2
- name: Build Docker Image
run: |
docker build -t dymo-cups .
docker build -t dymo-cups .
108 changes: 58 additions & 50 deletions .github/workflows/Static Analysis.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,63 @@
---

name: Static-Analysis

on: [push]

Check warning on line 5 in .github/workflows/Static Analysis.yaml

View workflow job for this annotation

GitHub Actions / YAML Lint Check

5:1 [truthy] truthy value should be one of [false, true]

jobs:
Shell_Lint_Check:
name: Shell Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Download Packages
run: |
sudo apt-get install shellcheck
- name: Shell Check
run: |
shellcheck *.sh
Dockerfile_Lint_Check:
name: Dockerfile Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Download Packages
run: |
sudo wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v2.10.0/hadolint-Linux-x86_64
sudo chmod +x /bin/hadolint .
- name: Dockerfile Lint
run: |
hadolint --failure-threshold error --verbose *Dockerfile
- name: Docker Compose Lint
run: |
docker-compose config || { echo "Invalid Docker Compose file"; exit 1; }
Markdown_Lint_Check:
name: Markdown Lint Check
runs-on: ubuntu-latest
steps:
- name: Install markdownlint-cli
run: npm install -g markdownlint-cli

- name: Checkout code
uses: actions/checkout@v2

- name: Run markdownlint
run: markdownlint '**/*.md'



Shell_Lint_Check:
name: Shell Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Download Packages
run: |
sudo apt-get install shellcheck
- name: Shell Check
run: |
echo "Running Shell Check"
shellcheck *.sh
Dockerfile_Lint_Check:
name: Dockerfile Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Download Packages
run: |
sudo wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v2.10.0/hadolint-Linux-x86_64

Check warning on line 30 in .github/workflows/Static Analysis.yaml

View workflow job for this annotation

GitHub Actions / YAML Lint Check

30:121 [line-length] line too long (121 > 120 characters)
sudo chmod +x /bin/hadolint .
- name: Dockerfile Lint
run: |
hadolint --failure-threshold error --verbose *Dockerfile
- name: Docker Compose Lint
run: |
docker-compose config || { echo "Invalid Docker Compose file"; exit 1; }
Markdown_Lint_Check:
name: Markdown Lint Check
runs-on: ubuntu-latest
steps:
- name: Install markdownlint-cli
run: npm install -g markdownlint-cli
- name: Checkout code
uses: actions/checkout@v2
- name: Run markdownlint
run: |
echo "Running markdownlint"
markdownlint '**/*.md'
YAML_Lint_Check:
name: YAML Lint Check
runs-on: ubuntu-latest
steps:
- name: Install yamllint
run: sudo apt install yamllint
- name: Checkout code
uses: actions/checkout@v2
- name: Run yamllint
run: |
echo "Checking YAML files"
yamllint -c .yamllint.yaml .github/**/**.yaml
35 changes: 35 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---

yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'

rules:
braces: enable
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start:
level: warning
empty-lines: enable
empty-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length:
max: 120
level: warning
new-line-at-end-of-file: enable
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy:
level: warning

0 comments on commit 0d80d32

Please sign in to comment.