Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: init quality action to run typecheck and lint #7

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Install dependencies'

runs:
using: composite
steps:
- uses: actions/setup-node@v3
with:
node-version-file: .node-version

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Get pnpm cache
id: pnpm-cache
uses: actions/cache@v3
with:
path: ${{ env.PNPM_STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
32 changes: 32 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Code quality'

on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint_and_typecheck:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/install

- run: pnpm typecheck

- run: pnpm lint

- run: pnpm prettier -c .
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.10.0
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"lint": "eslint .",
"prepare": "is-ci || husky install",
"start": "next start",
"storybook": "storybook dev -p 6006"
"storybook": "storybook dev -p 6006",
"typecheck": "tsc --noEmit"
},
"prettier": "@vercel/style-guide/prettier",
"dependencies": {
Expand Down Expand Up @@ -44,5 +45,6 @@
"prettier": "^3.1.0",
"storybook": "^7.6.4",
"typescript": "^5"
}
},
"packageManager": "[email protected]"
}