Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

chore: run Vite example typecheck after npm publish (#3652)

Igor Dykhta59eada0157e1
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 15b099782..6a8ccec48 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -69,21 +69,3 @@ jobs:
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
-
- typecheck-examples:
- name: Typecheck ${{ matrix.example }}
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- example: [get-started-vite, duckdb-vite]
-
- steps:
- - uses: actions/checkout@v4
- - uses: volta-cli/action@v4
-
- - name: Install and typecheck
- working-directory: examples/${{ matrix.example }}
- run: |
- yarn install
- yarn tsc -b --pretty false --noEmit
diff --git a/.github/workflows/typecheck-vite-examples.yml b/.github/workflows/typecheck-vite-examples.yml
new file mode 100644
index 000000000..9d53bfed3
--- /dev/null
+++ b/.github/workflows/typecheck-vite-examples.yml
@@ -0,0 +1,52 @@
+# Run after npm publish (and on manual dispatch), not on every PR.
+name: Typecheck examples
+
+on:
+ workflow_run:
+ workflows: [Node.js Package]
+ types: [completed]
+ workflow_dispatch:
+
+jobs:
+ wait-for-published-version:
+ if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Wait until this version is on npm
+ if: github.event_name == 'workflow_run'
+ run: |
+ VERSION=$(node -p "require('./package.json').version")
+ echo "Waiting for @kepler.gl/components@$VERSION"
+ for _ in $(seq 1 24); do
+ if npm view "@kepler.gl/components@$VERSION" version; then
+ exit 0
+ fi
+ sleep 15
+ done
+ echo "::error::Timed out waiting for @kepler.gl/components@$VERSION on npm"
+ exit 1
+
+ typecheck-examples:
+ name: Typecheck ${{ matrix.example }}
+ needs: wait-for-published-version
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ example: [get-started-vite, duckdb-vite]
+
+ steps:
+ - uses: actions/checkout@v4
+ - uses: volta-cli/action@v4
+
+ - name: Enable Yarn 4
+ run: corepack enable && corepack prepare [email protected] --activate
+
+ - name: Install and typecheck
+ working-directory: examples/${{ matrix.example }}
+ run: |
+ touch yarn.lock
+ yarn install
+ yarn tsc -b --pretty false