Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework actions for faster PR CI #2695

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/turf.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
name: CI build

on:
push:
branches:
- master
- support/6.x
pull_request:
branches:
- master
- support/6.x

permissions:
contents: read
Expand All @@ -24,6 +19,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4
Expand All @@ -37,5 +34,8 @@ jobs:
node-version: ${{ matrix.node-version }}

- run: pnpm install --frozen-lockfile
- run: pnpm lerna run build --since origin/master --ignore @turf/turf
- run: git diff --exit-code
- run: pnpm test
- run: pnpm lerna run test --since origin/master
# note: does not run linting
# note: does not run last-checks
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"{projectRoot}/test/**",
"{projectRoot}/types.ts"
],
"dependsOn": ["build"],
"dependsOn": [],
"cache": true
},
"last-checks": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lint:mrl": "mrl check",
"lint:prettier": "prettier --check .",
"preinstall": "npx only-allow pnpm",
"prepare": "husky && lerna run build",
"prepare": "husky",
"test": "pnpm run lint && lerna run test && lerna run --scope @turf/turf last-checks"
},
"lint-staged": {
Expand Down
1 change: 1 addition & 0 deletions packages/turf-difference/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function difference(
const properties = features.features[0].properties || {};

const differenced = polygonClipping.difference(geoms[0], ...geoms.slice(1));

if (differenced.length === 0) return null;
if (differenced.length === 1) return polygon(differenced[0], properties);
return multiPolygon(differenced, properties);
Expand Down