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: "/" directory: "/"
schedule: schedule:
interval: "monthly" interval: "monthly"
- package-ecosystem: "gomod" # Dependencies listed in go.mod - package-ecosystem: "gomod" # Dependencies listed in go.mod
directory: "/" # Location of package manifests directory: "/" # Location of package manifests
schedule: schedule:
interval: "weekly" interval: "weekly"

View File

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

View File

@ -14,8 +14,8 @@ on:
jobs: jobs:
linters: linters:
permissions: permissions:
contents: read # for actions/checkout to fetch code contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
timeout-minutes: 10 timeout-minutes: 10
strategy: strategy:
@ -32,7 +32,12 @@ jobs:
go-version: ${{ matrix.go-version }} go-version: ${{ matrix.go-version }}
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 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 uses: golangci/golangci-lint-action@v3
with: with:
version: latest 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