Test npm package #1
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: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- 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: 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/chai @types/mocha @types/node chai magickwand.js mocha ts-node tsconfig-paths | |
- 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 -r tsconfig-paths/register --timeout 120000 --v8-expose-gc *.test.?s | |
env: | |
TS_NODE_PROJECT: tsconfig.test.json |