migrate to lefthook & optionalize git hooks #149
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Quality | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
env: | |
NODE_VERSION: 18 | |
jobs: | |
lint: | |
name: Lint (ESLint) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Prepare | |
run: yarn prepare | |
- name: Run ESLint | |
run: yarn lint --fix=false | |
format: | |
name: Format (Prettier) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Prepare | |
run: yarn prepare | |
- name: Run Prettier | |
run: yarn format --check | |
test: | |
name: Run Unit Tests (Vitest) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Prepare | |
run: yarn prepare | |
- name: Run Vitest | |
run: yarn test run |