Skip to content

Test npm package

Test npm package #37

Workflow file for this run

name: Test npm package
on:
workflow_dispatch:
inputs:
version:
description: 'Package version to test'
required: true
jobs:
test_npm_package:
runs-on: ${{ matrix.platforms }}
strategy:
matrix:
platforms: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Use Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: 16.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
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 .
- name: Install from npm
run: npm install --force rlayers@${{ github.event.inputs.version }}
- name: Run the unit tests
run: |
rm package.json
npx jest -c jest.config.js
cra_react18_js:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-js
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build
cra_react18_ts:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-ts
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build
cra_react18_1_js:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-1-js
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build
cra_react18_1_ts:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-1-ts
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build
cra_react18_2_js:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-2-js
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build
cra_react18_2_ts:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-2-ts
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build
cra_react18_3_ts:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-3-ts
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build
nextjs12:
runs-on: ubuntu-latest
steps:
- name: Use Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: 16.x
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/next12
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build
nextjs13:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/next13
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build
nextjs13-esm:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/next13-esm
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build
nextjs14-esm:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/next14-esm
npm install
npm i rlayers@${{ github.event.inputs.version }}
npm run build