Skip to content

Commit

Permalink
ci: try type checking tsc using esbuild-built tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Jun 16, 2023
1 parent 1d3c0a1 commit f279568
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:
esbuild-platforms:
# Split this out into its own runner because it's slow
name: esbuild CI (All Platforms)
runs-on: ubuntu-latest

steps:
- name: Ensure all platforms can be built
run: make platform-all

esbuild-slow:
# Split these out into their own runner because they're very slow
name: esbuild CI (Slow Tests)
Expand All @@ -36,8 +45,8 @@ jobs:
- name: Uglify Tests
run: CI=1 make uglify

- name: Ensure all platforms can be built
run: make clean && make platform-all
- name: Type check tsc using tsc
run: make test-tsc

esbuild:
name: esbuild CI
Expand Down
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,24 @@ demo/uglify: | github/uglify
uglify: esbuild | demo/uglify
node scripts/uglify-tests.js

################################################################################
# This builds the TypeScript compiler, then uses it to type check tsc itself

github/tsc:
mkdir -p github/tsc
cd github/tsc && git init && git remote add origin https://github.com/Microsoft/TypeScript.git
cd github/tsc && git fetch --depth 1 origin e6ceba084147bd00045c573a1ba9843c0bb5c721 && git checkout FETCH_HEAD

test-tsc: esbuild | github/tsc
rm -fr demo/tsc
mkdir -p demo/tsc/built/local
cp -r github/tsc/src github/tsc/scripts demo/tsc
cp github/tsc/lib/*.d.ts demo/tsc/built/local
cd demo/tsc && node scripts/processDiagnosticMessages.mjs src/compiler/diagnosticMessages.json
./esbuild --bundle demo/tsc/src/tsc/tsc.ts --outfile=demo/tsc/built/local/tsc.js --platform=node --target=es2018 --packages=external
echo '{"dependencies":{"@types/node":"20.2.5","@types/microsoft__typescript-etw":"0.1.1","@types/source-map-support":"0.5.6"}}' > demo/tsc/package.json
cd demo/tsc && npm i --silent && echo 'Type checking tsc using tsc...' && time -p node ./built/local/tsc.js -p src/compiler

################################################################################
# This builds Rollup using esbuild and then uses it to run Rollup's test suite

Expand Down

0 comments on commit f279568

Please sign in to comment.