2021-11-13 09:13:38 +01:00
|
|
|
---
|
2022-11-03 11:30:36 +01:00
|
|
|
name: Lint
|
2021-08-21 16:40:27 +02:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2023-01-30 11:53:45 +01:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-08-21 16:40:27 +02:00
|
|
|
jobs:
|
2021-11-13 09:13:38 +01:00
|
|
|
golangci-lint:
|
2021-08-21 16:40:27 +02:00
|
|
|
runs-on: ubuntu-latest
|
2021-11-13 09:13:38 +01:00
|
|
|
steps:
|
2022-11-04 10:40:39 +01:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-30 10:54:26 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2021-08-21 16:40:27 +02:00
|
|
|
|
2022-01-30 10:43:48 +01:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2022-11-04 10:40:39 +01:00
|
|
|
uses: tj-actions/changed-files@v34
|
2022-01-30 10:43:48 +01:00
|
|
|
with:
|
|
|
|
files: |
|
2022-03-17 19:08:49 +01:00
|
|
|
*.nix
|
2022-01-30 10:43:48 +01:00
|
|
|
go.*
|
|
|
|
**/*.go
|
|
|
|
integration_test/
|
|
|
|
config-example.yaml
|
|
|
|
|
2021-11-13 09:13:38 +01:00
|
|
|
- name: golangci-lint
|
2022-01-30 10:43:48 +01:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2021-11-13 09:13:38 +01:00
|
|
|
uses: golangci/golangci-lint-action@v2
|
|
|
|
with:
|
2023-03-03 18:22:47 +01:00
|
|
|
version: v1.51.2
|
2022-05-16 14:40:45 +02:00
|
|
|
|
2022-01-28 18:40:39 +01:00
|
|
|
# Only block PRs on new problems.
|
|
|
|
# If this is not enabled, we will end up having PRs
|
|
|
|
# blocked because new linters has appared and other
|
|
|
|
# parts of the code is affected.
|
|
|
|
only-new-issues: true
|
|
|
|
|
2021-11-13 09:13:38 +01:00
|
|
|
prettier-lint:
|
|
|
|
runs-on: ubuntu-latest
|
2021-08-21 16:40:27 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-01-30 10:54:26 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2021-08-21 16:40:27 +02:00
|
|
|
|
2022-01-30 10:43:48 +01:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
|
|
|
uses: tj-actions/changed-files@v14.1
|
|
|
|
with:
|
|
|
|
files: |
|
2022-03-17 19:08:49 +01:00
|
|
|
*.nix
|
2022-01-30 10:43:48 +01:00
|
|
|
**/*.md
|
|
|
|
**/*.yml
|
|
|
|
**/*.yaml
|
|
|
|
**/*.ts
|
|
|
|
**/*.js
|
|
|
|
**/*.sass
|
|
|
|
**/*.css
|
|
|
|
**/*.scss
|
|
|
|
**/*.html
|
|
|
|
|
2021-11-13 09:13:38 +01:00
|
|
|
- name: Prettify code
|
2022-01-30 10:49:15 +01:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-02-26 13:12:31 +01:00
|
|
|
uses: creyD/prettier_action@v4.3
|
2021-11-13 09:13:38 +01:00
|
|
|
with:
|
|
|
|
prettier_options: >-
|
|
|
|
--check **/*.{ts,js,md,yaml,yml,sass,css,scss,html}
|
|
|
|
only_changed: false
|
|
|
|
dry: true
|
|
|
|
|
|
|
|
proto-lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-08-09 14:21:45 +02:00
|
|
|
- uses: bufbuild/buf-setup-action@v1.7.0
|
2021-11-13 09:13:38 +01:00
|
|
|
- uses: bufbuild/buf-lint-action@v1
|
2021-11-13 10:18:00 +01:00
|
|
|
with:
|
2021-11-13 10:20:59 +01:00
|
|
|
input: "proto"
|