From 6e7ba98010e24ca89bdba038f6b1772bc6aca223 Mon Sep 17 00:00:00 2001 From: Andre Henn Date: Mon, 24 Jun 2024 14:59:18 +0200 Subject: [PATCH 1/2] fix: tests and introduce pipeline for v5-main branch --- .github/workflows/on-pull-request.yml | 38 +++++++++++++++++++ .../MapFishPrintV3GeoJsonSerializer.spec.js | 29 +++++++++++++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/on-pull-request.yml diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml new file mode 100644 index 00000000..e7976761 --- /dev/null +++ b/.github/workflows/on-pull-request.yml @@ -0,0 +1,38 @@ +name: Test successful build of ol-util + +on: pull_request + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache Node.js modules 💾 + uses: actions/cache@v3 + with: + path: ~/.npm + key: "${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}" + restore-keys: | + ${{ runner.OS }}-node- + ${{ runner.OS }}- + + - name: Install dependencies ⏬ + run: npm install + + - name: Run tests 🩺 + run: npm run check + + - name: Build artifacts 🏗️ + run: npm run build diff --git a/spec/serializer/MapFishPrintV3GeoJsonSerializer.spec.js b/spec/serializer/MapFishPrintV3GeoJsonSerializer.spec.js index c8f65928..d0f49b92 100644 --- a/spec/serializer/MapFishPrintV3GeoJsonSerializer.spec.js +++ b/spec/serializer/MapFishPrintV3GeoJsonSerializer.spec.js @@ -79,6 +79,7 @@ describe('MapFishPrintV3GeoJsonSerializer', () => { coordinates: [0, 0] }, properties: { + '_style': 0 } }, { type: 'Feature', @@ -87,6 +88,7 @@ describe('MapFishPrintV3GeoJsonSerializer', () => { coordinates: [[0, 0], [1, 1]] }, properties: { + '_style': 1 } }, { type: 'Feature', @@ -95,12 +97,37 @@ describe('MapFishPrintV3GeoJsonSerializer', () => { coordinates: [[[0, 0], [1, 1], [0, 0]]] }, properties: { + '_style': 2 } }] }, name: layer.get('name') || 'Vector Layer', opacity: layer.getOpacity(), - style: {}, + style: { + '0': { + fillColor: '#ffffff', + fillOpacity: 0.4, + graphicName: 'circle', + pointRadius: 5, + rotation: 0, + strokeColor: '#3399cc', + strokeOpacity: 1, + strokeWidth: 1.25, + version: 2, + }, + '1': { + strokeColor: '#3399cc', + strokeOpacity: 1, + strokeWidth: 1.25, + }, + '2': { + fillColor: '#ffffff', + fillOpacity: 0.4, + strokeColor: '#3399cc', + strokeOpacity: 1, + strokeWidth: 1.25, + }, + }, type: 'geojson' }); }); From 7b29837032f4085a3a650ac320754941bc1e422b Mon Sep 17 00:00:00 2001 From: Andre Henn Date: Mon, 24 Jun 2024 15:01:32 +0200 Subject: [PATCH 2/2] fix: test and build steps --- .github/workflows/on-pull-request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index e7976761..86dfcb28 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -1,4 +1,4 @@ -name: Test successful build of ol-util +name: Test successful build of mapfish print manager (v5-main) on: pull_request @@ -32,7 +32,7 @@ jobs: run: npm install - name: Run tests 🩺 - run: npm run check + run: npm run test - name: Build artifacts 🏗️ - run: npm run build + run: npm run build:dist