Skip to content

Commit f07ce08

Browse files
committed
Use actions/cache and matrix in GitHub Actions
1 parent 02643b5 commit f07ce08

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

.github/workflows/test.yml renamed to .github/workflows/ci.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: Test
4+
name: CI
55

66
on:
77
push:
@@ -15,8 +15,8 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [13.x]
19-
deno: [0.40.0]
18+
node: [13.x]
19+
deno: [v0.40.0]
2020

2121
steps:
2222
- uses: actions/checkout@v2
@@ -25,20 +25,32 @@ jobs:
2525
run:
2626
sudo apt install -y automake build-essential git pkg-config python
2727
python-pip unzip
28+
- name: Cache emsdk
29+
uses: actions/cache@v1
30+
id: cache # This is important!
31+
with:
32+
# Set to the same folder as actions-cache-folder (more below)
33+
path: "emsdk-cache"
34+
# Set the end bit to emsdk version
35+
key: ${{ runner.os }}-emsdk-1.39.12
2836
- name: Setup emsdk (use cache if found, create otherwise)
2937
uses: mymindstorm/setup-emsdk@v2
3038
with:
3139
version: 1.39.12
32-
- name: Install Node.js 13
40+
actions-cache-folder: "emsdk-cache"
41+
# This stops it from using tc.cacheDir since we are using
42+
# actions/cache.
43+
no-cache: true
44+
- name: Install Node.js ${{ matrix.node }}
3345
uses: actions/setup-node@v1
3446
env:
3547
RUNNER_TEMP: /tmp
3648
with:
37-
node-version: "13.x"
38-
- name: Setup Deno latest
49+
node-version: ${{ matrix.node }}
50+
- name: Install Deno ${{ matrix.deno }}
3951
run:
4052
curl -fsSL https://deno.land/x/install/install.sh | sudo
41-
DENO_INSTALL=/usr/local sh
53+
DENO_INSTALL=/usr/local sh -s ${{ matrix.deno }}
4254
- name: Download and build dependencies
4355
run: make deps
4456
env:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Viz.js
22

3-
[![Build Status](https://travis-ci.org/mdaines/viz.js.svg?branch=master)](https://travis-ci.org/mdaines/viz.js)
3+
[![CI](https://github.com/aduh95/viz.js/workflows/CI/badge.svg)](https://github.com/aduh95/viz.js/actions)
44

55
This project builds [Graphviz](http://www.graphviz.org) with
66
[Emscripten](http://kripken.github.io/emscripten-site/) and provides a simple

test/browser.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ args[args.findIndex(flag => /enable-features/.test(flag))] +=
66
",ExperimentalProductivityFeatures,ImportMaps";
77
const PUPPETEER_OPTIONS = { args };
88

9+
const closableMock = { close: Function.prototype };
10+
911
describe("Test graph rendering using web browser", function() {
1012
/**
1113
* @type {{close:Promise<void>, port: Promise<number>}}
1214
*/
13-
let server;
15+
let server = closableMock;
1416

1517
/**
1618
* @type {Browser}
1719
*/
18-
let browser;
20+
let browser = closableMock;
1921

2022
/**
2123
* @type {Page}

0 commit comments

Comments
 (0)