-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set up separate lint workflow and test with pr workflow
- Loading branch information
1 parent
eb0ecc4
commit c4dea85
Showing
2 changed files
with
73 additions
and
64 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,72 @@ | ||
# This reusable workflow is executed to run linting checks for the project | ||
name: Run lint for the project | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [20.x] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install & cache node_modules | ||
uses: Khan/actions@shared-node-cache-v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Get All Changed Files | ||
uses: Khan/actions@get-changed-files-v2 | ||
id: changed | ||
|
||
- id: js-ts-files | ||
name: Find .js, .ts changed files | ||
uses: Khan/actions@filter-files-v1 | ||
with: | ||
changed-files: ${{ steps.changed.outputs.files }} | ||
extensions: '.js,.jsx,.ts,.tsx' | ||
|
||
- id: eslint-reset | ||
uses: Khan/actions@filter-files-v1 | ||
name: Files that would trigger a full eslint run | ||
with: | ||
changed-files: ${{ steps.changed.outputs.files }} | ||
files: '.eslintrc.js,yarn.lock,.eslintignore' | ||
|
||
- id: typecheck-reset | ||
uses: Khan/actions@filter-files-v1 | ||
name: Files that would trigger a typecheck run | ||
with: | ||
changed-files: ${{ steps.changed.outputs.files }} | ||
files: '.yarn.lock' | ||
|
||
# Linting / type checking | ||
- name: Eslint | ||
uses: Khan/actions@full-or-limited-v0 | ||
with: | ||
full-trigger: ${{ steps.eslint-reset.outputs.filtered }} | ||
full: yarn lint:ci . | ||
limited-trigger: ${{ steps.js-ts-files.outputs.filtered }} | ||
limited: yarn lint:ci {} | ||
|
||
- name: Typecheck | ||
if: always() # always run this check until we update the eslint config | ||
# if: steps.js-ts-files.outputs.filtered != '[]' || steps.typecheck-reset.outputs.filtered != '[]' | ||
run: yarn typecheck | ||
|
||
- name: Build .js bundles | ||
run: yarn build | ||
|
||
- name: Build .d.ts types | ||
run: yarn build:types | ||
|
||
- name: Check package.json files | ||
run: node utils/publish/pre-publish-check-ci.js |
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