Skip to content

Commit

Permalink
ci: add eslint and ts checking (#2)
Browse files Browse the repository at this point in the history
* ci: add eslint and ts checking

* style: refactor name of ts lint job and branch name
  • Loading branch information
uigywnkiub authored Jul 5, 2024
1 parent 310fd5b commit 901a470
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Lint
on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
push:
branches:
- main
env:
CACHE_NAME: cache-node-modules
jobs:
lint:
name: Linting, Typechecking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache node modules
id: cache-yarn
uses: actions/cache@v4
with:
# another cache folder on ubuntu
# path: ~/.cache/yarn
path: ${{ steps.yarn-cache-dir-path.outputs.yarn_cache_dir }}
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}\
-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-
${{ runner.os }}-build-
${{ runner.os }}-

- if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: yarn list

- name: Install Dependencies
run: yarn install --immutable

- name: Run ESLint
run: yarn lint

- name: Run TypeScript
run: yarn typecheck

0 comments on commit 901a470

Please sign in to comment.