console/.github/workflows/lint.yaml
2023-01-11 11:26:42 +01:00

53 lines
1.3 KiB
YAML

on:
workflow_call:
jobs:
eslint-and-prettier:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup environment
uses: ./.github/actions/setup
- name: eslint cache
uses: actions/cache@v3
with:
path: '.eslintcache'
key: ${{ runner.os }}-eslint-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-eslint
- name: eslint
id: eslint
run: pnpm lint
env:
TIMING: 'true'
DEBUG: 'eslint:cli-engine'
- name: eslint tip
if: ${{ steps.eslint.outcome }} == 'failure'
run: echo "Run pnpm lint --fix"
- name: prettier
id: prettier
run: pnpm lint:prettier
- name: eslint tip
if: ${{ steps.prettier.outcome }} == 'failure'
run: echo "Run pnpm format"
- name: Generate Types
run: yarn graphql:generate
- name: Operation Check
run: |
npx graphql-inspector validate \
"packages/web/app/**/*.graphql|packages/libraries/cli/**/*.graphql|packages/web/app/**/*.ts(x)" \
"packages/**/module.graphql.ts" \
--maxDepth=20 \
--maxAliasCount=20 \
--maxDirectiveCount=20 \
--maxTokenCount=800