2022-11-03 11:30:36 +01:00
|
|
|
name: Lint
|
2021-08-21 15:40:27 +01:00
|
|
|
|
2024-03-13 13:43:06 +01:00
|
|
|
on: [pull_request]
|
2021-08-21 15:40:27 +01:00
|
|
|
|
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 15:40:27 +01:00
|
|
|
jobs:
|
2021-11-13 08:13:38 +00:00
|
|
|
golangci-lint:
|
2021-08-21 15:40:27 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-11-13 08:13:38 +00:00
|
|
|
steps:
|
2024-03-13 13:43:06 +01:00
|
|
|
- uses: actions/checkout@v4
|
2022-01-30 09:54:26 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2022-01-30 09:43:48 +00:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2024-03-13 13:43:06 +01:00
|
|
|
uses: dorny/paths-filter@v3
|
2022-01-30 09:43:48 +00:00
|
|
|
with:
|
2024-03-13 13:43:06 +01:00
|
|
|
filters: |
|
|
|
|
files:
|
|
|
|
- '*.nix'
|
|
|
|
- 'go.*'
|
|
|
|
- '**/*.go'
|
|
|
|
- 'integration_test/'
|
|
|
|
- 'config-example.yaml'
|
2024-02-18 13:33:40 +01:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
2024-03-13 13:43:06 +01:00
|
|
|
if: steps.changed-files.outputs.files == 'true'
|
2024-02-18 13:33:40 +01:00
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
2024-03-13 13:43:06 +01:00
|
|
|
if: steps.changed-files.outputs.files == 'true'
|
2024-02-18 13:33:40 +01:00
|
|
|
|
2021-11-13 08:13:38 +00:00
|
|
|
- name: golangci-lint
|
2024-03-13 13:43:06 +01:00
|
|
|
if: steps.changed-files.outputs.files == 'true'
|
2024-09-05 13:37:05 +02:00
|
|
|
run: nix develop --command -- golangci-lint run --new-from-rev=${{github.event.pull_request.base.sha}} --out-format=colored-line-number
|
2022-01-28 17:40:39 +00:00
|
|
|
|
2021-11-13 08:13:38 +00:00
|
|
|
prettier-lint:
|
|
|
|
runs-on: ubuntu-latest
|
2021-08-21 15:40:27 +01:00
|
|
|
steps:
|
2024-03-13 13:43:06 +01:00
|
|
|
- uses: actions/checkout@v4
|
2022-01-30 09:54:26 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2022-01-30 09:43:48 +00:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2024-03-13 13:43:06 +01:00
|
|
|
uses: dorny/paths-filter@v3
|
2022-01-30 09:43:48 +00:00
|
|
|
with:
|
2024-03-13 13:43:06 +01:00
|
|
|
filters: |
|
|
|
|
files:
|
|
|
|
- '*.nix'
|
|
|
|
- '**/*.md'
|
|
|
|
- '**/*.yml'
|
|
|
|
- '**/*.yaml'
|
|
|
|
- '**/*.ts'
|
|
|
|
- '**/*.js'
|
|
|
|
- '**/*.sass'
|
|
|
|
- '**/*.css'
|
|
|
|
- '**/*.scss'
|
|
|
|
- '**/*.html'
|
2024-02-18 13:33:40 +01:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
2024-03-13 13:43:06 +01:00
|
|
|
if: steps.changed-files.outputs.files == 'true'
|
2024-02-18 13:33:40 +01:00
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
2024-03-13 13:43:06 +01:00
|
|
|
if: steps.changed-files.outputs.files == 'true'
|
2024-02-18 13:33:40 +01:00
|
|
|
|
2021-11-13 08:13:38 +00:00
|
|
|
- name: Prettify code
|
2024-03-13 13:43:06 +01:00
|
|
|
if: steps.changed-files.outputs.files == 'true'
|
2024-02-18 13:33:40 +01:00
|
|
|
run: nix develop --command -- prettier --no-error-on-unmatched-pattern --ignore-unknown --check **/*.{ts,js,md,yaml,yml,sass,css,scss,html}
|
2021-11-13 08:13:38 +00:00
|
|
|
|
|
|
|
proto-lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-03-13 13:43:06 +01:00
|
|
|
- uses: actions/checkout@v4
|
2024-02-18 13:33:40 +01:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
|
|
|
|
|
|
- name: Buf lint
|
|
|
|
run: nix develop --command -- buf lint proto
|