🤖 add github workflow (lint and format) #2
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: Lint and Format | |
on: | |
push: | |
branches: ['*'] | |
pull_request: | |
branches: ['*'] | |
jobs: | |
lint-and-format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.yarn-cache | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile | |
- name: Run Linter | |
run: yarn lint | |
- name: Run Formatter | |
run: yarn format |