feat(CI): add a GitHub Action to lint the YAML files

Add a `.yamllint` config file
Lint YAML.

https://yamllint.readthedocs.io/en/stable/
This commit is contained in:
John Bampton 2021-02-15 03:42:20 +10:00
parent 1bdf86b722
commit 4bd0b4dc96
3 changed files with 45 additions and 15 deletions

22
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Lint
on: [pull_request]
jobs:
yamllint:
name: YAML
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install yamllint
- name: YAML Lint
run: |
# return non-zero exit code on warnings
yamllint --strict .

View File

@ -3,21 +3,21 @@ language: go
matrix:
fast_finish: true
include:
- go: 1.12.x
env: GO111MODULE=on
- go: 1.13.x
- go: 1.13.x
env:
- TESTTAGS=nomsgpack
- go: 1.14.x
- go: 1.14.x
env:
- TESTTAGS=nomsgpack
- go: 1.15.x
- go: 1.15.x
env:
- TESTTAGS=nomsgpack
- go: master
- go: 1.12.x
env: GO111MODULE=on
- go: 1.13.x
- go: 1.13.x
env:
- TESTTAGS=nomsgpack
- go: 1.14.x
- go: 1.14.x
env:
- TESTTAGS=nomsgpack
- go: 1.15.x
- go: 1.15.x
env:
- TESTTAGS=nomsgpack
- go: master
git:
depth: 10

8
.yamllint Normal file
View File

@ -0,0 +1,8 @@
---
extends: default
rules:
document-start: disable
line-length: disable
truthy: disable