-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (42 loc) · 1.4 KB
/
npm-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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