1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-09-16 17:50:44 +02:00

Run golangci and prettier through nix

This commit is contained in:
Kristoffer Dalby 2022-05-18 18:10:40 +02:00
parent 9ead2bf5fa
commit b8967ea278

View File

@ -22,17 +22,21 @@ jobs:
integration_test/ integration_test/
config-example.yaml config-example.yaml
- name: golangci-lint - uses: cachix/install-nix-action@v16
if: steps.changed-files.outputs.any_changed == 'true' if: steps.changed-files.outputs.any_changed == 'true'
uses: golangci/golangci-lint-action@v2
with:
version: v1.46.1
# Only block PRs on new problems. - uses: actions/cache@v3
# If this is not enabled, we will end up having PRs if: steps.changed-files.outputs.any_changed == 'true'
# blocked because new linters has appared and other with:
# parts of the code is affected. path: |
only-new-issues: true /nix
key: ${{ runner.os }}-nix-${{ hashFiles('**/flake.lock') }}
restore-keys: |
${{ runner.os }}-nix-
- name: Run Integration tests
if: steps.changed-files.outputs.any_changed == 'true'
run: nix develop --command -- golangci-lint run --timeout 10m
prettier-lint: prettier-lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -57,14 +61,21 @@ jobs:
**/*.scss **/*.scss
**/*.html **/*.html
- name: Prettify code - uses: cachix/install-nix-action@v16
if: steps.changed-files.outputs.any_changed == 'true'
- uses: actions/cache@v3
if: steps.changed-files.outputs.any_changed == 'true' if: steps.changed-files.outputs.any_changed == 'true'
uses: creyD/prettier_action@v4.0
with: with:
prettier_options: >- path: |
--check **/*.{ts,js,md,yaml,yml,sass,css,scss,html} /nix
only_changed: false key: ${{ runner.os }}-nix-${{ hashFiles('**/flake.lock') }}
dry: true restore-keys: |
${{ runner.os }}-nix-
- name: Run Integration tests
if: steps.changed-files.outputs.any_changed == 'true'
run: nix develop --command -- prettier --check '**/**.{ts,js,md,yaml,yml,sass,css,scss,html}'
proto-lint: proto-lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest