Test npm #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test npm | |
on: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
container: node:20 | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: install and npm test | |
run: | | |
set -ex | |
mkdir tmp | |
cd tmp | |
yarn init -y | |
yarn add chameleon-ultra.js serialport tsx | |
cat << "EOF" > index.cjs | |
const { version } = require('chameleon-ultra.js') | |
console.log(`index.cjs: SDK version = ${version}`) | |
process.exit(typeof version === 'string' ? 0 : 1) | |
EOF | |
node ./index.cjs | |
cat << "EOF" > index.mjs | |
import { version } from 'chameleon-ultra.js' | |
console.log(`index.mjs: SDK version = ${version}`) | |
process.exit(typeof version === 'string' ? 0 : 1) | |
EOF | |
node ./index.mjs | |
cat << "EOF" > index.cts | |
const { version } = require('chameleon-ultra.js') | |
console.log(`index.cts: SDK version = ${version}`) | |
process.exit(typeof version === 'string' ? 0 : 1) | |
EOF | |
yarn tsx ./index.cts | |
cat << "EOF" > index.mts | |
import { version } from 'chameleon-ultra.js' | |
console.log(`index.mts: SDK version = ${version}`) | |
process.exit(typeof version === 'string' ? 0 : 1) | |
EOF | |
yarn tsx ./index.mts |