Test npm package #6
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 package | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Package version to test' | |
required: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x, 20.x] | |
platform: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: (if on Ubuntu) install fonts | |
run: sudo apt-get install -y fonts-ubuntu || true | |
if: ${{ contains(matrix.platform, 'ubuntu') }} | |
- name: Set up the unit tests | |
run: | | |
curl https://codeload.github.com/mmomtchev/ffmpeg/zip/refs/tags/v${{ github.event.inputs.version }} --output repo.zip | |
unzip repo.zip | |
mv ffmpeg-${{ github.event.inputs.version }}/test . | |
npm install @types/[email protected] @types/mocha @types/node [email protected] magickwand.js mocha ts-node readable-stream-clone | |
- name: Install from npm | |
run: npm i @mmomtchev/ffmpeg@${{ github.event.inputs.version }} | |
- name: Run the unit tests | |
run: | | |
cd test | |
npx mocha --reporter=tap -r ts-node/register --timeout 120000 --v8-expose-gc *.cjs *.mjs *.ts | |
env: | |
TS_NODE_PROJECT: tsconfig.test.json |