From 8c9993ce1307d2963476099ed0a866bf7ed96ba2 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Wed, 2 Oct 2024 17:07:21 +0200 Subject: [PATCH] drop the obsolete xvfb action --- .github/workflows/test-package.yml | 47 ++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index 31d35e7..1617970 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -67,10 +67,16 @@ jobs: mv node_modules/magickwand.js/test . mkdir -p deps/ImageMagick/config cp node_modules/magickwand.js/deps/ImageMagick/config/policy-websafe.xml deps/ImageMagick/config - - name: Run the unit tests headless - uses: coactions/setup-xvfb@v1 - with: - run: npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts + - name: Run the unit tests headless (macOS/Windows) + run: npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts + if: runner.os != 'Linux' + env: + TS_NODE_PROJECT: ${{ github.workspace }}/test/tsconfig.standalone.json + MOCHA_INTEGRATION: node,browser + MOCHA_MAGICK_INSTALL: npm install --force ${{ inputs.download && format('{0}/{1}', github.workspace, inputs.package) || inputs.package }} + - name: Run the unit tests headless (Linux) + run: xvfb-run npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts + if: runner.os == 'Linux' env: TS_NODE_PROJECT: ${{ github.workspace }}/test/tsconfig.standalone.json MOCHA_INTEGRATION: node,browser @@ -128,10 +134,18 @@ jobs: mv node_modules/magickwand.js/test . mkdir -p deps/ImageMagick/config cp node_modules/magickwand.js/deps/ImageMagick/config/policy-websafe.xml deps/ImageMagick/config - - name: Run the unit tests headless - uses: coactions/setup-xvfb@v1 - with: - run: npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts + - name: Run the unit tests headless (macOS/Windows) + run: npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts + if: runner.os != 'Linux' + env: + TS_NODE_PROJECT: ${{ github.workspace }}/test/tsconfig.standalone.json + MOCHA_INTEGRATION: node,browser + MOCHA_MAGICK_INSTALL: npm install --force ${{ inputs.download && format('{0}/{1}', github.workspace, inputs.package) || inputs.package }} + MOCHA_LIGHT: 1 + MOCHA_EXTRALIGHT: 1 + - name: Run the unit tests headless (Linux) + run: xvfb-run npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts + if: runner.os == 'Linux' env: TS_NODE_PROJECT: ${{ github.workspace }}/test/tsconfig.standalone.json MOCHA_INTEGRATION: node,browser @@ -139,6 +153,7 @@ jobs: MOCHA_LIGHT: 1 MOCHA_EXTRALIGHT: 1 + test_npm_rebuild_light: runs-on: ${{ matrix.platform }} @@ -240,10 +255,18 @@ jobs: mv node_modules/magickwand.js/test . mkdir -p deps/ImageMagick/config cp node_modules/magickwand.js/deps/ImageMagick/config/policy-websafe.xml deps/ImageMagick/config - - name: Run the unit tests headless - uses: coactions/setup-xvfb@v1 - with: - run: npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts + - name: Run the unit tests headless (macOS/Windows) + run: npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts + if: runner.os != 'Linux' + env: + TS_NODE_PROJECT: ${{ github.workspace }}/test/tsconfig.standalone.json + MOCHA_INTEGRATION: node,browser + MOCHA_MAGICK_INSTALL: npm install --force ${{ inputs.download && format('{0}/{1}', github.workspace, inputs.package) || inputs.package }} + MOCHA_LIGHT: 1 + MOCHA_EXTRALIGHT: 1 + - name: Run the unit tests headless (Linux) + run: xvfb-run npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts + if: runner.os == 'Linux' env: TS_NODE_PROJECT: ${{ github.workspace }}/test/tsconfig.standalone.json MOCHA_INTEGRATION: node,browser