2021-11-13 01:13:38 -07:00
|
|
|
---
|
2022-11-03 04:30:36 -06:00
|
|
|
name: Lint
|
2021-08-21 08:40:27 -06:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2023-01-30 03:53:45 -07:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-08-21 08:40:27 -06:00
|
|
|
jobs:
|
2021-11-13 01:13:38 -07:00
|
|
|
golangci-lint:
|
2021-08-21 08:40:27 -06:00
|
|
|
runs-on: ubuntu-latest
|
2021-11-13 01:13:38 -07:00
|
|
|
steps:
|
2022-11-04 03:40:39 -06:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-30 02:54:26 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2021-08-21 08:40:27 -06:00
|
|
|
|
2022-01-30 02:43:48 -07:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2022-11-04 03:40:39 -06:00
|
|
|
uses: tj-actions/changed-files@v34
|
2022-01-30 02:43:48 -07:00
|
|
|
with:
|
|
|
|
files: |
|
2022-03-17 12:08:49 -06:00
|
|
|
*.nix
|
2022-01-30 02:43:48 -07:00
|
|
|
go.*
|
|
|
|
**/*.go
|
|
|
|
integration_test/
|
|
|
|
config-example.yaml
|
|
|
|
|
2024-02-18 05:33:40 -07:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
|
|
|
2021-11-13 01:13:38 -07:00
|
|
|
- name: golangci-lint
|
2022-01-30 02:43:48 -07:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2024-02-18 05:33:40 -07:00
|
|
|
run: nix develop --command -- golangci-lint run --new-from-rev=${{github.event.pull_request.base.sha}} --out-format=github-actions .
|
2022-01-28 10:40:39 -07:00
|
|
|
|
2021-11-13 01:13:38 -07:00
|
|
|
prettier-lint:
|
|
|
|
runs-on: ubuntu-latest
|
2021-08-21 08:40:27 -06:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-01-30 02:54:26 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2021-08-21 08:40:27 -06:00
|
|
|
|
2022-01-30 02:43:48 -07:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
|
|
|
uses: tj-actions/changed-files@v14.1
|
|
|
|
with:
|
|
|
|
files: |
|
2022-03-17 12:08:49 -06:00
|
|
|
*.nix
|
2022-01-30 02:43:48 -07:00
|
|
|
**/*.md
|
|
|
|
**/*.yml
|
|
|
|
**/*.yaml
|
|
|
|
**/*.ts
|
|
|
|
**/*.js
|
|
|
|
**/*.sass
|
|
|
|
**/*.css
|
|
|
|
**/*.scss
|
|
|
|
**/*.html
|
|
|
|
|
2024-02-18 05:33:40 -07:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
|
|
|
2021-11-13 01:13:38 -07:00
|
|
|
- name: Prettify code
|
2022-01-30 02:49:15 -07:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2024-02-18 05:33:40 -07: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 01:13:38 -07:00
|
|
|
|
|
|
|
proto-lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2024-02-18 05:33:40 -07:00
|
|
|
|
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
|
|
|
|
|
|
- name: Buf lint
|
|
|
|
run: nix develop --command -- buf lint proto
|