mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
70 lines
2 KiB
YAML
70 lines
2 KiB
YAML
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
eslint-and-prettier:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: setup environment
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
actor: lint
|
|
|
|
- name: lint .env.template files
|
|
run: pnpm lint:env-template
|
|
|
|
- name: Cache ESLint and Prettier
|
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
|
with:
|
|
path: |
|
|
.eslintcache
|
|
node_modules/.cache/prettier
|
|
key:
|
|
lint-cache-${{ hashFiles('**/pnpm-lock.yaml', 'packages/web/*/tailwind.config.ts',
|
|
'tsconfig.eslint.json', 'packages/web/app/tsconfig.json') }}
|
|
restore-keys: |
|
|
lint-cache-${{ hashFiles('**/pnpm-lock.yaml', 'packages/web/*/tailwind.config.ts',
|
|
'tsconfig.eslint.json', 'packages/web/app/tsconfig.json') }}-
|
|
|
|
- name: eslint
|
|
id: eslint
|
|
run: |
|
|
pnpm lint --cache-strategy content || \
|
|
( \
|
|
echo "" && \
|
|
echo "To fix it, run" && \
|
|
echo "$ pnpm run lint:fix" && \
|
|
echo "" && \
|
|
exit 1 \
|
|
)
|
|
env:
|
|
TIMING: 'true'
|
|
|
|
- name: prettier
|
|
id: prettier
|
|
shell: sh
|
|
run: |
|
|
pnpm lint:prettier || \
|
|
( \
|
|
echo "" && \
|
|
echo "To fix it, run" && \
|
|
echo "$ pnpm run prettier" && \
|
|
echo "" && \
|
|
exit 1 \
|
|
)
|
|
|
|
- name: Operation Check
|
|
run: |
|
|
npx graphql-inspector validate \
|
|
"packages/web/app/src/**/*.{graphql,tsx}|packages/libraries/cli/**/*.graphql|packages/web/app/src/lib/**/*.ts" \
|
|
"packages/**/module.graphql.ts" \
|
|
--maxDepth=20 \
|
|
--maxAliasCount=20 \
|
|
--maxDirectiveCount=20 \
|
|
--maxTokenCount=1000
|