portainer/portainer

View on GitHub
.github/workflows/lint.yml

Summary

Maintainability
Test Coverage
name: Lint

on:
  push:
    branches:
      - master
      - develop
      - release/*
  pull_request:
    branches:
      - master
      - develop
      - release/*
    types:
      - opened
      - reopened
      - synchronize
      - ready_for_review

env:
  GO_VERSION: 1.21.9
  NODE_VERSION: 18.x

jobs:
  run-linters:
    name: Run linters
    runs-on: ubuntu-latest
    if: github.event.pull_request.draft == false

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: ${{ env.NODE_VERSION }}
          cache: 'yarn'
      - uses: actions/setup-go@v4
        with:
          go-version: ${{ env.GO_VERSION }}
      - run: yarn --frozen-lockfile
      - name: Run linters
        uses: wearerequired/lint-action@v1
        with:
          eslint: true
          eslint_extensions: ts,tsx,js,jsx
          prettier: true
          prettier_dir: app/
          gofmt: true
          gofmt_dir: api/
      - name: Typecheck
        uses: icrawl/action-tsc@v1
      - name: GolangCI-Lint
        uses: golangci/golangci-lint-action@v3
        with:
          version: v1.55.2
          args: --timeout=10m -c .golangci.yaml