feat(TypeScript): Add the workflow file for CI check (#1280)

* feat(TypeScript): Add the workflow file for CI check

* fix: Install TypeScript Execute (tsx)

* test: Test failed

* test: Test successful

* test: on windows

* Add a bug

* feat: type checking

* test: Test successful

* feat: add main

* fix: use process

* feat: use es-main

* Test failure

* feat: streamlined configuration

* Apply suggestions from code review
Co-authored-by: Yudong Jin <krahets@163.com>

* feat: remove lock file

* Test failure

* Test success

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
Shyam Chen
2024-04-19 18:48:58 +08:00
committed by GitHub
parent 499419e4ce
commit 587344da62
8 changed files with 52 additions and 17 deletions

26
.github/workflows/typescript.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: TypeScript
on:
push:
branches: ['main']
paths: ['codes/typescript/**/*.ts']
pull_request:
branches: ['main']
paths: ['codes/typescript/**/*.ts']
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install dependencies
run: cd codes/typescript && npm install
- name: Check TypeScript code
run: cd codes/typescript && npm run check