-
Notifications
You must be signed in to change notification settings - Fork 390
68 lines (56 loc) · 1.68 KB
/
Copy pathtest.yml
File metadata and controls
68 lines (56 loc) · 1.68 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Test
on:
push:
branches:
- main
- next
pull_request:
types:
- opened
- synchronize
merge_group:
workflow_call:
permissions:
contents: read
env:
FORCE_COLOR: 1
NPM_CONFIG_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm clean-install
- run: npm install --global corepack@latest
- run: corepack npm audit signatures
- run: npm run format:check
- run: npm run lint
- run: npm run build
- name: Create npm tarball
id: pack
run: |
TARBALL_PATH=$(npm pack | tail -n 1)
echo "TARBALL_FULL_PATH=$(pwd)/$TARBALL_PATH" >> $GITHUB_ENV
- name: Verify tarball installation in isolation
working-directory: ${{ runner.temp }}
run: |
mkdir test-tarball-install
cd test-tarball-install
# Initialize a dummy project and install the tarball
npm init -y
npm install ${{ env.TARBALL_FULL_PATH }} --omit=dev
# Verify CommonJS (CJS) works via require()
echo "Testing CommonJS resolution..."
node -e "const mp4box = require('mp4box'); console.log('CJS Success:', typeof mp4box);"
# Verify ECMAScript Modules (ESM) works via import
echo "Testing ESM resolution..."
node --input-type=module -e "import * as mp4box from 'mp4box'; console.log('ESM Success:', typeof mp4box);"
- run: npm run circular
- run: npm run test