-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: add eslint and ts checking * style: refactor name of ts lint job and branch name
- Loading branch information
1 parent
310fd5b
commit 901a470
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
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 |