-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ScottGibb/1-add-yamllint-to-ci-pipeline
Adding yamllint to project
- Loading branch information
Showing
3 changed files
with
96 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,63 @@ | ||
--- | ||
|
||
name: Static-Analysis | ||
|
||
on: [push] | ||
|
||
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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |