Skip to content

Commit

Permalink
Fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-dldc committed Aug 4, 2024
1 parent 80fb4ae commit 701c759
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 89 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ jobs:
with:
deno-version: v1.x # Run with latest stable Deno.

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y -q --no-install-recommends libfontconfig1 libstdc++6
- run: deno task check

- run: npx jsr publish
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "7.0.1",
"exports": "./mod.ts",
"imports": {
"$canvas/": "https://deno.land/x/[email protected]/",
"@dldc/erreur": "jsr:@dldc/erreur@^7.1.1",
"@gfx/canvas": "jsr:@gfx/canvas@^0.5.6",
"@std/expect": "jsr:@std/expect@^1.0.0",
"@std/fs": "jsr:@std/fs@^1.0.1",
"@std/path": "jsr:@std/path@^1.0.2"
Expand Down
88 changes: 12 additions & 76 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tests/images/basic-spring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/sequence-insertAt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/sequence-replaceTail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/spring-bounce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/spring-decay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/spring-delay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/spring-identity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/spring-negative-delay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/spring-overdamped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/spring-underdamped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions tests/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CanvasRenderingContext2D } from "@gfx/canvas";
import { createCanvas } from "@gfx/canvas";
import type { CanvasRenderingContext2D } from "$canvas/mod.ts";
import { createCanvas } from "$canvas/mod.ts";
import { exists } from "@std/fs";
import { resolve } from "@std/path";

Expand Down Expand Up @@ -30,11 +30,11 @@ export type SpringExport = Array<[time: number, pos: number, vel: number]>;
* Generate an image that show the spring
* and returns data
*/
export function canvasImage(
export async function canvasImage(
spring: ISpringFn,
fileName: string,
{ width = 600, timeAxis, position, velocity, events }: CanvasImageConfig,
): SpringExport {
): Promise<SpringExport> {
// create value for each width pixel
const values: SpringExport = [];
for (let x = 0; x <= width; x++) {
Expand Down Expand Up @@ -128,7 +128,7 @@ export function canvasImage(
ctx.restore();

const targetFile = resolve("tests", "images", fileName + ".png");
canvas.save(targetFile);
await Deno.writeFile(targetFile, canvas.toBuffer());
return values;
}

Expand Down Expand Up @@ -158,7 +158,7 @@ export async function matchCanvasImage(
fileName: string,
config: CanvasImageConfig,
) {
const data = canvasImage(
const data = await canvasImage(
spring,
fileName,
config,
Expand Down

0 comments on commit 701c759

Please sign in to comment.