From 59920981a679ad3a90ba2033578134292df02d35 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Sun, 5 Feb 2023 18:30:06 +0100 Subject: [PATCH] ci(lint): setup YAML Lint step (#68) Setup YAMLLint --------- Signed-off-by: Matthieu MOREL --- .github/dependabot.yml | 3 ++- .github/workflows/test.yml | 28 +++++++++++++--------------- .github/workflows/validate.yml | 11 ++++++++--- .yamllint.yml | 9 +++++++++ 4 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 .yamllint.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7e790c0..7f451b7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0bd1b6e..cc1986a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 ./... diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index b1ab393..65ab94d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -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 diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..1b2830c --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,9 @@ +--- +extends: default + +rules: + document-start: disable + line-length: disable + truthy: + ignore: | + .github/workflows/*.yml