Skip to content

Commit

Permalink
Add Hooks testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Oct 8, 2024
1 parent ccbedb3 commit 7750f84
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ jobs:
- name: Docker Data Task Test
run: docker run cloudtak-data:latest npm test

hooks:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha || github.sha}}

- name: Docker Hooks Task Build
run: docker buildx build ./tasks/hooks -t cloudtak-hooks

- name: Docker Hooks Task Lint
run: docker run cloudtak-hooks:latest npm run lint

- name: Docker Data Task Test
run: docker run cloudtak-hooks:latest npm test

pmtiles:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
Expand Down
5 changes: 4 additions & 1 deletion tasks/hooks/src/adaptors/arcgis.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Geometry, Point, Polyline, Polygon } from 'arcgis-rest-api';
import { geojsonToArcGIS } from '@terraformer/arcgis'
// @ts-expect-error Default export behavior
import proj4 from 'proj4';

export default async function arcgis(data: any): Promise<boolean> {
Expand Down Expand Up @@ -58,10 +57,14 @@ export default async function arcgis(data: any): Promise<boolean> {
let geom = geojsonToArcGIS(data.feat.geometry) as Polyline;

console.error(geom);

geometry = geom;
} else if (data.feat.geometry.type === 'Polygon') {
let geom = geojsonToArcGIS(data.feat.geometry) as Polygon;

console.error(geom);

geometry = geom;
} else {
throw new Error(`Incompatible Geometry: ${data.feat.geometry.type}`);
}
Expand Down

0 comments on commit 7750f84

Please sign in to comment.