Skip to content

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

chore: cache Yarn, freeze lockfile, and skip Python CI on JS PRs (#3647)

Igor Dykhta56cad19dc760
diff --git a/.github/workflows/build-publish-pypi.yml b/.github/workflows/build-publish-pypi.yml
index 800e9a0c4..54f2ffd8e 100644
--- a/.github/workflows/build-publish-pypi.yml
+++ b/.github/workflows/build-publish-pypi.yml
@@ -2,6 +2,17 @@ name: Build and Publish KeplerGL Python Package
on:
push:
+ branches: [master]
+ paths:
+ - 'bindings/python/**'
+ - '.github/workflows/build-publish-pypi.yml'
+ - 'package.json'
+ pull_request:
+ branches: [master]
+ paths:
+ - 'bindings/python/**'
+ - '.github/workflows/build-publish-pypi.yml'
+ - 'package.json'
workflow_dispatch:
inputs:
prerelease:
diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml
index eafd50aa4..a59d400ba 100644
--- a/.github/workflows/npmpublish.yml
+++ b/.github/workflows/npmpublish.yml
@@ -17,8 +17,10 @@ jobs:
# use Volta to manage yarn/node versions
- uses: volta-cli/action@v4
- - run: yarn install
- - run: yarn bootstrap
+ - run: yarn install --immutable && yarn bootstrap
+ env:
+ HUSKY: 0
+ PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
- name: Login to NPM
run: npm config set "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}"
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 5c7668160..277a15da9 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -9,6 +9,10 @@ on:
pull_request:
branches: [master]
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
jobs:
build:
runs-on: ubuntu-latest
@@ -18,17 +22,37 @@ jobs:
# use Volta to manage yarn/node versions
- uses: volta-cli/action@v4
+ - name: Get Yarn cache directory
+ id: yarn-cache-dir
+ run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
+
+ - name: Cache Yarn
+ uses: actions/cache@v4
+ with:
+ path: ${{ steps.yarn-cache-dir.outputs.dir }}
+ key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-yarn-
+
- name: Install XVFB
run: sudo apt-get install xvfb
- name: Install Dependencies
- run: yarn install && yarn bootstrap
+ run: yarn install --immutable && yarn bootstrap
+ env:
+ HUSKY: 0
+ PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
# - name: Install Puppeteer
# run: yarn dlx "[email protected]"
+ - name: Typecheck
+ run: yarn typescript
+
- name: Lint
- run: yarn lint
+ # Check-only (`yarn lint:check`) currently fails on ~650 existing
+ # prettier/prettier issues. Switch after a formatting cleanup.
+ run: yarn eslint src test webpack examples website --fix --ignore-path .gitignore
- name: Test
run: xvfb-run --auto-servernum yarn cover
diff --git a/package.json b/package.json
index 1d21923a4..012408718 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,7 @@
"url": "https://github.com/keplergl/kepler.gl.git"
},
"scripts": {
- "bootstrap": "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true git submodule update --init --recursive && yarn install && yarn fix-dependencies && yarn workspaces foreach -At run stab",
+ "bootstrap": "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true git submodule update --init --recursive && yarn install --immutable && yarn fix-dependencies && yarn workspaces foreach -At run stab",
"install:example": "cd examples/demo-app && NODE_OPTIONS=--openssl-legacy-provider yarn",
"install:web": "yarn install:example && cd website && yarn",
"install-and-start": "node ./scripts/install-and-start",
@@ -87,6 +87,7 @@
"example-version": "babel-node ./scripts/edit-version.js",
"prettier-all": "prettier --write '{examples,src}/**/src/**/*.{js,tsx,ts}' 'test/**/*.{js,ts,tsx}'",
"lint": "yarn typescript && eslint src test webpack examples website --fix --ignore-path .gitignore",
+ "lint:check": "yarn typescript && eslint src test webpack examples website --ignore-path .gitignore",
"lint:css": "stylelint './src/**/*.js'",
"typescript": "tsc --noEmit",
"web": "(yarn && yarn install:web && yarn start:web)",