ci(lint): setup YAML Lint step (#68)

Setup YAMLLint

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL 2023-02-05 18:30:06 +01:00 committed by GitHub
parent 7a452d2d15
commit 59920981a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 19 deletions

View File

@ -4,7 +4,8 @@ updates:
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "gomod" # Dependencies listed in go.mod
directory: "/" # Location of package manifests
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

View File

@ -14,7 +14,7 @@ on:
jobs:
test:
permissions:
contents: read # for actions/checkout to fetch code
contents: read # for actions/checkout to fetch code
timeout-minutes: 10
strategy:
@ -29,17 +29,15 @@ jobs:
os: [ubuntu-20.04, ubuntu-22.04, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code
- name: Test
run: |
go test -exec "sudo -n" -v ./...
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code
- name: Test
run: go test -exec "sudo -n" -v ./...

View File

@ -14,8 +14,8 @@ on:
jobs:
linters:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
timeout-minutes: 10
strategy:
@ -32,7 +32,12 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Lint
- name: YAML Lint
if: runner.os == 'Linux'
uses: ibiqlik/action-yamllint@v3
with:
format: auto
- name: Golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest

9
.yamllint.yml Normal file
View File

@ -0,0 +1,9 @@
---
extends: default
rules:
document-start: disable
line-length: disable
truthy:
ignore: |
.github/workflows/*.yml