From 52b171a86f498f70dca9b7e196fa9b32f8b5dfbf Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Sat, 27 Jul 2024 21:21:09 +0200 Subject: [PATCH] always test with the current OpenLayers version --- .github/workflows/test-npm.yml | 41 ++++++++++++++++++---------------- package.json | 2 +- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-npm.yml b/.github/workflows/test-npm.yml index 65bbed4..6ce0a70 100644 --- a/.github/workflows/test-npm.yml +++ b/.github/workflows/test-npm.yml @@ -3,9 +3,12 @@ name: Test npm package on: workflow_dispatch: inputs: - version: + rlayers: description: 'Package version to test' required: true + ol: + description: 'OL version to use' + required: true jobs: test_npm_package: @@ -23,15 +26,15 @@ jobs: node-version: 20.x - name: Set up the unit tests run: | - curl https://codeload.github.com/mmomtchev/rlayers/zip/refs/tags/v${{ github.event.inputs.version }} --output repo.zip + curl https://codeload.github.com/mmomtchev/rlayers/zip/refs/tags/v${{ github.event.inputs.rlayers }} --output repo.zip unzip repo.zip - mv rlayers-${{ github.event.inputs.version }}/package.json . - mv rlayers-${{ github.event.inputs.version }}/tsconfig*.json . - mv rlayers-${{ github.event.inputs.version }}/jest.standalone.config.js jest.config.js - mv rlayers-${{ github.event.inputs.version }}/examples . - mv rlayers-${{ github.event.inputs.version }}/test . + mv rlayers-${{ github.event.inputs.rlayers }}/package.json . + mv rlayers-${{ github.event.inputs.rlayers }}/tsconfig*.json . + mv rlayers-${{ github.event.inputs.rlayers }}/jest.standalone.config.js jest.config.js + mv rlayers-${{ github.event.inputs.rlayers }}/examples . + mv rlayers-${{ github.event.inputs.rlayers }}/test . - name: Install from npm - run: npm install --force rlayers@${{ github.event.inputs.version }} + run: npm install rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} - name: Run the unit tests run: | rm package.json @@ -48,7 +51,7 @@ jobs: run: | cd rlayers-npm-tests/cra-react18-js npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build cra_react18_ts: @@ -60,7 +63,7 @@ jobs: run: | cd rlayers-npm-tests/cra-react18-ts npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build cra_react18_1_js: @@ -72,7 +75,7 @@ jobs: run: | cd rlayers-npm-tests/cra-react18-1-js npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build cra_react18_1_ts: @@ -84,7 +87,7 @@ jobs: run: | cd rlayers-npm-tests/cra-react18-1-ts npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build cra_react18_2_js: @@ -96,7 +99,7 @@ jobs: run: | cd rlayers-npm-tests/cra-react18-2-js npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build cra_react18_2_ts: @@ -108,7 +111,7 @@ jobs: run: | cd rlayers-npm-tests/cra-react18-2-ts npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build cra_react18_3_ts: @@ -120,7 +123,7 @@ jobs: run: | cd rlayers-npm-tests/cra-react18-3-ts npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build nextjs12: @@ -136,7 +139,7 @@ jobs: run: | cd rlayers-npm-tests/next12 npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build nextjs13: @@ -148,7 +151,7 @@ jobs: run: | cd rlayers-npm-tests/next13 npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build nextjs13-esm: @@ -160,7 +163,7 @@ jobs: run: | cd rlayers-npm-tests/next13-esm npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build nextjs14-esm: @@ -172,5 +175,5 @@ jobs: run: | cd rlayers-npm-tests/next14-esm npm install - npm i rlayers@${{ github.event.inputs.version }} + npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }} npm run build diff --git a/package.json b/package.json index 93ffce5..e5ca214 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "preversion": "npm run test", "version": "npm run clean && npm run build && git add package.json", "postversion": "git push && git push --tags && npm run doc:publish", - "postpublish": "gh workflow run test-npm.yml -F version=$npm_package_version" + "postpublish": "gh workflow run test-npm.yml -F rlayers=$npm_package_version -F ol=`node -p 'require(\"./package.json\").peerDependencies.ol'`" }, "repository": { "type": "git",