Skip to content

Commit

Permalink
Enable tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
1000ch committed Oct 22, 2021
1 parent 6dc878d commit 24b0a51
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: test
on:
- push
- pull_request
Expand All @@ -15,6 +15,7 @@ jobs:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
9 changes: 8 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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}`,
Expand Down

0 comments on commit 24b0a51

Please sign in to comment.