Skip to content

Commit

Permalink
always test with the current OpenLayers version
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Jul 27, 2024
1 parent dc25160 commit 52b171a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/test-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 52b171a

Please sign in to comment.