From 24b0a51c916fc0cf6b8d90c29ddb225eeaf56be2 Mon Sep 17 00:00:00 2001 From: 1000ch Date: Fri, 22 Oct 2021 23:02:47 +0900 Subject: [PATCH] Enable tests on Windows --- .github/workflows/test.yml | 3 ++- readme.md | 2 +- test/test.js | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 084e470..c364634 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: CI +name: test on: - push - pull_request @@ -15,6 +15,7 @@ jobs: os: - ubuntu-latest - macos-latest + - windows-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 diff --git a/readme.md b/readme.md index ea2d3c7..b4f55a0 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# guetzli-bin ![GitHub Actions Status](https://github.com/imagemin/guetzli-bin/workflows/test/badge.svg?branch=master) +# guetzli-bin ![GitHub Actions Status](https://github.com/imagemin/guetzli-bin/workflows/test/badge.svg?branch=main) > [Guetzli](https://github.com/google/guetzli) is a JPEG encoder that aims for excellent compression density at high visual quality. Guetzli-generated images are typically 20-30% smaller than images of equivalent quality generated by libjpeg. diff --git a/test/test.js b/test/test.js index 2449b0e..5f83660 100644 --- a/test/test.js +++ b/test/test.js @@ -1,4 +1,5 @@ import path from 'node:path'; +import process from 'node:process'; import {fileURLToPath} from 'node:url'; import test from 'ava'; import execa from 'execa'; @@ -10,9 +11,15 @@ import executable from 'executable'; import guetzli from '../index.js'; test('rebuild the guetzli binaries', async t => { - const temporary = tempy.directory(); + // Skip the test on Windows + if (process.platform === 'win32') { + t.pass(); + return; + } + const temporary = tempy.directory(); const source = fileURLToPath(new URL('../vendor/source/guetzli-1.0.1.tar.gz', import.meta.url)); + await binBuild.file(source, [ `mkdir -p ${temporary}`, `make && mv bin/Release/guetzli ${temporary}`,