diff --git a/.github/workflows/modified-plugin.yml b/.github/workflows/modified-plugin.yml index f9d326e52..7192b76b0 100644 --- a/.github/workflows/modified-plugin.yml +++ b/.github/workflows/modified-plugin.yml @@ -59,6 +59,7 @@ jobs: needs: changes if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }} strategy: + fail-fast: false matrix: package: ${{ fromJSON(needs.changes.outputs.packages) }} uses: ./.github/workflows/test-python-package.yml @@ -108,6 +109,7 @@ jobs: # Only build main docs for push on main branch and PRs to main if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' && (github.ref == 'refs/heads/main' || github.base_ref == 'main') && (github.event_name == 'push' || github.event_name == 'pull_request')}} strategy: + fail-fast: false matrix: package: ${{ fromJSON(needs.changes.outputs.packages) }} uses: ./.github/workflows/build-main-docs.yml diff --git a/.github/workflows/test-js-packages.yml b/.github/workflows/test-js-packages.yml index 8d50cba59..60416dca7 100644 --- a/.github/workflows/test-js-packages.yml +++ b/.github/workflows/test-js-packages.yml @@ -55,10 +55,18 @@ jobs: if: steps.restore-node-modules.outputs.cache-hit != 'true' run: npm ci --no-audit + - name: Build check + run: npm run build + + - name: Type check + if: always() # Can still run types even if the build fails + run: npm run types + # Run all tests for all the packages # Caching with the absolute path b/c Jest will make a folder in each project # Then there's caches in all plugin folders - name: Run Tests + if: always() # Can still run jest tests even if the build/types fail run: npm run test:ci - name: Always cache node modules diff --git a/.github/workflows/test-python-package.yml b/.github/workflows/test-python-package.yml index 166e2233a..b81764f95 100644 --- a/.github/workflows/test-python-package.yml +++ b/.github/workflows/test-python-package.yml @@ -11,6 +11,7 @@ jobs: test: runs-on: ubuntu-22.04 strategy: + fail-fast: false matrix: python: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: diff --git a/.github/workflows/typescript-check.yml b/.github/workflows/typescript-check.yml deleted file mode 100644 index 73042926a..000000000 --- a/.github/workflows/typescript-check.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Check TypeScript types - -on: - push: - branches: - - main - - 'release/**' - - 'feature/**' - pull_request: - branches: - - main - - 'release/**' - - 'feature/**' - -jobs: - typescript-check: - runs-on: ubuntu-latest - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: npm ci - - name: Check TypeScript types - run: python tools/check_typescript_ci.py - diff --git a/package.json b/package.json index df3c2a606..08d6b944f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "docker": "docker compose up deephaven-plugins --build", "start": "run-p \"start:packages -- {@}\" serve:plugins --", "build": "lerna run build --stream", - "watch:types": "tsc -p . --watch --emitDeclarationOnly false --noEmit", + "types": "tsc", + "watch:types": "tsc --watch", "serve:plugins": "vite", "start:packages": "lerna run start --stream", "test": "jest --watch --changedSince origin/main", diff --git a/plugins/example-theme/src/js/package.json b/plugins/example-theme/src/js/package.json index 256ef3385..de90ea049 100644 --- a/plugins/example-theme/src/js/package.json +++ b/plugins/example-theme/src/js/package.json @@ -5,7 +5,7 @@ "main": "dist/index.js", "scripts": { "dev": "vite", - "build": "tsc && vite build", + "build": "vite build", "preview": "vite preview", "start": "npm run build -- -w", "update-dh-packages": "node ../../../../tools/update-dh-packages.mjs" diff --git a/plugins/plotly-express/src/js/package.json b/plugins/plotly-express/src/js/package.json index 61c4739ef..cb1874386 100644 --- a/plugins/plotly-express/src/js/package.json +++ b/plugins/plotly-express/src/js/package.json @@ -32,7 +32,7 @@ "homepage": "https://github.com/deephaven/deephaven-plugins", "scripts": { "start": "vite build --watch", - "build": "tsc && vite build", + "build": "vite build", "update-dh-packages": "node ../../../../tools/update-dh-packages.mjs" }, "devDependencies": { diff --git a/tools/check_typescript_ci.py b/tools/check_typescript_ci.py deleted file mode 100644 index 6f07f38dd..000000000 --- a/tools/check_typescript_ci.py +++ /dev/null @@ -1,50 +0,0 @@ -from re import fullmatch -from subprocess import run -from sys import exit - - -def main(): - print("Checking TypeScript types...") - res = run( - ["npx", "tsc", "-p", ".", "--emitDeclarationOnly", "false", "--noEmit"], - capture_output=True, - ) - - if res.returncode == 0: - return 0 - - messages = [] - for line in res.stdout.decode("utf-8").splitlines(): - if len(line) == 0: - continue - # If there's an indent, that means it's a continuation of the previous line - # For example, the error message could be like: - # > Argument of type 'FUNCTION_1_TYPE | undefined' is not assignable to parameter of type 'FUNCTION_2_TYPE'. - # > Type 'FUNCTION_1_TYPE' is not assignable to type 'FUNCTION_2_TYPE'. - # > Types of parameters `PARAM_1` and `PARAM_2` are incompatible. - # > Type 'PARAM_1_TYPE' is not assignable to type 'PARAM_2_TYPE'. - if line[0] == " " and len(messages) > 0: - messages[-1] += "\n" + line - else: - messages.append(line) - - for message in messages: - # Check if the message is actually an error and extract the details - # Error message format: file(line,col): error_message - match = fullmatch(r"(.+?)\((\d+),(\d+)\): ([\s\S]+)", message) - if match is None: - continue - - file, line, col, error_message = match.groups() - # Newlines in GitHub Actions annotations are escaped as %0A - # https://github.com/actions/toolkit/issues/193#issuecomment-605394935 - error_message = error_message.replace("\n", "%0A") - # GitHub Actions annotation format - print(f"::error file={file},line={line},col={col}::{error_message}") - - return res.returncode - - -if __name__ == "__main__": - # Exit with returncode so GitHub Actions fails properly - exit(main()) diff --git a/tsconfig.json b/tsconfig.json index cd20a0503..298ce2ca3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,9 @@ { "extends": "@deephaven/tsconfig", + "compilerOptions": { + "emitDeclarationOnly": false, + "noEmit": true + }, "include": [ "plugins/**/**.ts", "plugins/**/**.tsx",