Add yamllint, fix most yaml errors

This commit is contained in:
Michał Sochoń 2024-01-11 21:45:58 +01:00
parent d292784f8f
commit 5ca5a12b99
4 changed files with 48 additions and 22 deletions

View file

@ -1,10 +1,11 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"

View file

@ -1,3 +1,4 @@
---
name: "CI"
on:
push:
@ -37,7 +38,9 @@ jobs:
build-test:
name: Build and Test
runs-on: ubuntu-20.04
needs: [ "lint", "shellcheck" ]
needs:
- lint
- shellcheck
steps:
- uses: actions/checkout@v3
- name: Build Docker image
@ -55,7 +58,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Run integration test 1
- name: Run integration test 1 - good Dockerfile
uses: ./
with:
dockerfile: testdata/Dockerfile
@ -117,6 +120,15 @@ jobs:
# format: sarif
# output-file: report.sarif
- name: Run integration test 9 - run with no Dockerfiles
# This should not fail if no Dockerfiles are found in the path
# especially if git change deletes Dockerfile
uses: testdata/test_empty_dir
with:
dockerfile: ""
failure-threshold: error
recursive: true
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: Release

View file

@ -1,12 +1,23 @@
- repo: local
hooks:
- id: lint-dockerfile
name: Lint Dockerfile
entry: make lint-dockerfile
language: system
files: \.yml$
- id: lint-yaml
name: Lint YAML
entry: make lint-yaml
language: system
files: \.yml$
---
repos:
- repo: local
hooks:
- id: lint-dockerfile
name: Lint Dockerfile
entry: make lint-dockerfile
language: system
files: \.yml$
- id: lint-yaml
name: Lint YAML
entry: make lint-yaml
language: system
files: \.yml$
- repo: https://github.com/adrienverge/yamllint
rev: v1.33.0
hooks:
- id: yamllint
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck

View file

@ -6,3 +6,5 @@ rules:
max: 80
level: warning
document-start: disable
truthy:
level: warning