Skip to content

Commit

Permalink
Merge pull request #294 from GordonSmith/OSX_TEST
Browse files Browse the repository at this point in the history
chore: add osx build tests
  • Loading branch information
GordonSmith authored Jan 22, 2025
2 parents 486273c + 417cd9e commit 2c9dd8b
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 14 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ on:

jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-13, macos-14]
node: [18, 20, 22]

name: Node ${{ matrix.node }} sample
runs-on: ${{ matrix.os }}
name: Node ${{ matrix.os }}, node-${{ matrix.node }} sample
steps:
- name: Checkout Sources
uses: actions/checkout@v4
Expand All @@ -26,27 +27,46 @@ jobs:
registry-url: "https://registry.npmjs.org"
scope: "@hpcc-js"

- name: Install OS Dependencies
- name: Install Ubuntu Dependencies
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y git cmake ninja-build wget zip
sudo apt-get install -y gcc-multilib g++-multilib pkg-config autoconf bison libtool flex
sudo apt-get install -y python3 python3-pip
- name: Install OSX Dependencies
if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install ninja flex bison automake autoconf-archive coreutils
if [[ $(uname -m) == 'arm64' ]]; then
echo "PATH=/opt/homebrew/opt/bison/bin:/opt/homebrew/opt/flex/bin:$PATH" >> $GITHUB_ENV
else
echo "PATH=/usr/local/opt/bison/bin:/opt/homebrew/opt/flex/bin:$PATH" >> $GITHUB_ENV
fi
bison --version
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Dependencies
- name: npm ci
run: |
bison --version
npm ci
sudo npx playwright install chromium --with-deps
- name: npx playwright install
run: |
npx playwright install --with-deps
- name: install-build-deps
run: |
npm run install-build-deps
- name: Lint
run: |
npm run lint
Expand All @@ -60,15 +80,15 @@ jobs:
npm run test
- name: Calculate Coverage
if: ${{ matrix.node == 20 }}
if: ${{ matrix.os == 'ubuntu-24.04' && matrix.node == 20 }}
run: |
npm run coverage
- name: Upload error logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.node }}-logs
name: ${{ matrix.os }}-${{ matrix.node }}-logs
path: |
./vcpkg/buildtrees/**/*.log
./build/**/*.log
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
![Tests](https://github.com/hpcc-systems/hpcc-js-wasm/workflows/Test%20PR/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/GordonSmith/hpcc-js-wasm/badge.svg?branch=BUMP_VERSIONS)](https://coveralls.io/github/GordonSmith/hpcc-js-wasm?branch=BUMP_VERSIONS)

**Note: @hpcc-js/wasm is now an ESM by default package** - this is a good thing, but does require some breaking changes.

This repository contains a collection of useful c++ libraries compiled to WASM for (re)use in Node JS, Web Browsers and JavaScript Libraries:
- [base91](https://base91.sourceforge.net/) - v0.6.0
- [duckdb](https://github.com/duckdb/duckdb) - v1.1.1
Expand Down Expand Up @@ -128,3 +126,39 @@ Graphviz.load().then(graphviz => {
console.log(graphviz.version());
});
```

## Build Instructions

The following instructions are for building the entire repository from scratch. In general the instructions assume you are running from within a bash terminal.

* Windows (With WSL2 and Git Bash installed)
* Linux (native or WSL2)
* MacOS
* Docker

## Pre-requisites

To get an idea of what pre-requisites are required, please see the following files:

* [Dockerfile](docker/ubuntu-dev.dockerfile)
* [GH Action Ubuntu](.github/workflows/test-pr.yml)
* NodeJS

## Steps (Docker)

```bash
git clone https://github.com/hpcc-systems/hpcc-js-wasm.git
cd hpcc-js-wasm
npm ci
npm run build-docker
```

## Steps (Windows, Linux, MacOS)

```bash
git clone https://github.com/hpcc-systems/hpcc-js-wasm.git
cd hpcc-js-wasm
npm ci
npm run install-build-deps
npm run build
```
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
],
"scripts": {
"install-emsdk": "run-script-os",
"install-emsdk:linux": "./scripts/cpp-install-emsdk.sh",
"install-emsdk:default": "./scripts/cpp-install-emsdk.sh",
"install-emsdk:win32": "wsl -e ./scripts/cpp-install-emsdk.sh",
"install-vcpkg": "run-script-os",
"install-vcpkg:linux": "./scripts/cpp-install-vcpkg.sh",
"install-vcpkg:default": "./scripts/cpp-install-vcpkg.sh",
"install-vcpkg:win32": "wsl -e ./scripts/cpp-install-vcpkg.sh",
"install-playright": "npx playwright install",
"install-build-deps": "run-s install-emsdk install-vcpkg install-playright",
Expand All @@ -43,7 +43,7 @@
"gen-docs": "typedoc",
"gen-docs-watch": "typedoc --watch",
"build-cpp": "run-script-os",
"build-cpp:linux": "./scripts/cpp-build.sh",
"build-cpp:default": "./scripts/cpp-build.sh",
"build-cpp:win32": "wsl -e ./scripts/cpp-build.sh",
"build-cpp-watch": "chokidar 'packages/*/src-cpp/**/*' -c 'npm run build-cpp'",
"build-types-watch": "lerna run build-types-watch",
Expand Down
20 changes: 19 additions & 1 deletion vcpkg-overlays/graphviz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ include(CTest)
# hpcc-js-wasm add_subdirectory(contrib/prune)
# hpcc-js-wasm add_subdirectory(graphs)
add_subdirectory(lib)
add_subdirectory(plugin)
# add_subdirectory(plugin)
if(GRAPHVIZ_CLI)
# hpcc-js-wasm add_subdirectory(cmd)
endif()
Expand All @@ -621,6 +621,24 @@ if(with_cxx_tests)
endif()

# === hpcc-js-wasm ===
add_subdirectory(plugin/core)
# add_subdirectory(plugin/devil)
add_subdirectory(plugin/dot_layout)
add_subdirectory(plugin/gd)
# add_subdirectory(plugin/gdiplus)
# add_subdirectory(plugin/gdk)
# add_subdirectory(plugin/gs)
# add_subdirectory(plugin/kitty)
# add_subdirectory(plugin/lasi)
add_subdirectory(plugin/neato_layout)
add_subdirectory(plugin/pango)
# add_subdirectory(plugin/poppler)
# add_subdirectory(plugin/quartz)
# add_subdirectory(plugin/rsvg)
# add_subdirectory(plugin/vt)
add_subdirectory(plugin/webp)
# add_subdirectory(plugin/xlib)

add_library(graphviz INTERFACE)

target_include_directories(graphviz
Expand Down

0 comments on commit 2c9dd8b

Please sign in to comment.