Skip to content

Commit

Permalink
Add generate_metadata crate for TypeScript types and docs
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Stein <steinlink@gmail.com>
  • Loading branch information
texodus committed Oct 17, 2024
1 parent c9c1da4 commit 3b7559d
Show file tree
Hide file tree
Showing 86 changed files with 1,681 additions and 2,292 deletions.
19 changes: 17 additions & 2 deletions .github/actions/install-deps/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ inputs:
python:
default: "true"
description: "Install Python dependencies?"
playwright:
default: "false"
description: "Install browsers for playwright testing"
clean:
default: "false"
description: "Clean unused deps. This is helpful if we run out of HD but slow!"
Expand Down Expand Up @@ -117,13 +120,25 @@ runs:
vcpkg.exe integrate install
echo "VCPKG_INSTALLATION_ROOT=${env:VCPKG_INSTALLATION_ROOT}"
echo "VCPKG_INSTALLATION_ROOT=${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_OUTPUT
echo "${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_PATH
echo "VCPKG_ROOT=${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_ENV
dir env:
env:
PYTHON_VERSION: ${{ matrix.python-version }}
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_PLATFORM_TOOLSET: v143
if: ${{ runner.os == 'Windows' && inputs.cpp == 'true' }}

# https://github.com/apache/arrow/issues/38391
- if: ${{ runner.os == 'macOS' }}
shell: bash
run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)" >> $GITHUB_ENV

# Use python 3.9 from manylinu
- run: echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH
shell: bash
if: ${{ runner.os == 'Linux' }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
if: ${{ inputs.python == 'true' && runner.os != 'Linux' }}
Expand Down Expand Up @@ -179,12 +194,12 @@ runs:

- name: Install JS dependencies
shell: bash
if: ${{ inputs.javascript == 'true' }}
if: ${{ inputs.javascript == 'true' && inputs.playwright == 'true' }}
run: pnpm install

- name: Install JS dependencies
shell: bash
if: ${{ inputs.javascript == 'false' }}
if: ${{ inputs.javascript == 'false' || inputs.playwright == 'false'}}
run: pnpm install --ignore-scripts

- name: Install Python dependencies
Expand Down
115 changes: 83 additions & 32 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,58 @@ concurrency:
cancel-in-progress: true

jobs:
# , . . .-,--.
# ) . ,-. |- ,-. ,-. ,-| ' | \ ,-. ,-. ,-.
# / | | | | ,-| | | | | , | / | | | `-.
# `--' ' ' ' `' `-^ ' ' `-^ `-^--' `-' `-' `-'
#
lint_and_docs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
python-version:
- 3.9
node-version: [20.x]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Config
id: config-step
uses: ./.github/actions/config

- name: Initialize Build
id: init-step
uses: ./.github/actions/install-deps
with:
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- name: Metadata Build
run: pnpm run build --ci
env:
PACKAGE: "perspective-metadata"

- name: Lint
run: pnpm run lint

# - name: Docs Build
# run: pnpm run docs

- uses: actions/upload-artifact@v4
with:
name: perspective-metadata
path: |
rust/perspective-server/cpp/
rust/perspective-server/cmake/
rust/perspective-client/src/
rust/perspective-client/docs/
rust/perspective-js/src/ts/
rust/perspective-viewer/src/ts/
# ,-,---. . . ,-_/ .---. .
# '|___/ . . . | ,-| ' | ,-. . , ,-. \___ ,-. ,-. . ,-. |-
# ,| \ | | | | | | | ,-| | / ,-| \ | | | | | |
Expand All @@ -67,6 +119,7 @@ jobs:
# `--' '
build_js:
runs-on: ${{ matrix.os }}
needs: [lint_and_docs]
strategy:
fail-fast: false
matrix:
Expand All @@ -84,29 +137,26 @@ jobs:
id: config-step
uses: ./.github/actions/config

- uses: actions/download-artifact@v4
with:
name: perspective-metadata
path: rust/

- name: Initialize Build
id: init-step
uses: ./.github/actions/install-deps
with:
clean: "true"
python: "false"
playwright: "true"
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- name: WebAssembly Build
run: pnpm run build --ci
env:
PACKAGE: "!perspective-python,!perspective-jupyterlab"
PACKAGE: "perspective-cpp,perspective,perspective-viewer,perspective-viewer-datagrid,perspective-viewer-d3fc,perspective-viewer-openlayers,perspective-workspace,perspective-cli"
# PSP_USE_CCACHE: 1

- name: Lint
run: pnpm run lint

# - name: Docs Build
# run: pnpm run docs

# env:
# PACKAGE: "!perspective-python,!perspective-jupyterlab"

- uses: actions/upload-artifact@v4
with:
name: perspective-js-dist
Expand All @@ -130,6 +180,7 @@ jobs:
# `-'
build_python:
runs-on: ${{ matrix.os }}
needs: [lint_and_docs]
container: ${{ matrix.container }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -169,6 +220,11 @@ jobs:
id: config-step
uses: ./.github/actions/config

- uses: actions/download-artifact@v4
with:
name: perspective-metadata
path: rust/

- name: Initialize Build
id: init-step
uses: ./.github/actions/install-deps
Expand All @@ -178,16 +234,6 @@ jobs:
manylinux: ${{ matrix.container && 'true' || 'false' }}
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- run: echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH
if: ${{ runner.os == 'Linux' }}

# https://github.com/apache/arrow/issues/38391
- if: ${{ runner.os == 'macOS' }}
run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)" >> $GITHUB_ENV

- run: echo "${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}" >> $env:GITHUB_PATH
if: ${{ runner.os == 'Windows' }}

- name: Python Build
run: pnpm run build
if: ${{ !contains(matrix.os, 'windows') }}
Expand All @@ -205,7 +251,6 @@ jobs:
env:
CARGO_TARGET_DIR: D:\psp-rust
PSP_ROOT_DIR: ${{ github.workspace }}
VCPKG_ROOT: ${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}
PACKAGE: "perspective-python"
PSP_ARCH: ${{ matrix.arch }}
PSP_BUILD_WHEEL: 1
Expand Down Expand Up @@ -235,6 +280,7 @@ jobs:
#
build_and_test_rust:
runs-on: ${{ matrix.os }}
needs: [lint_and_docs]
strategy:
fail-fast: false
matrix:
Expand All @@ -257,6 +303,11 @@ jobs:
id: config-step
uses: ./.github/actions/config

- uses: actions/download-artifact@v4
with:
name: perspective-metadata
path: rust/

- name: Initialize Build
id: init-step
uses: ./.github/actions/install-deps
Expand All @@ -266,25 +317,21 @@ jobs:
manylinux: "false"
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- run: echo "${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}" >> $env:GITHUB_PATH
if: ${{ runner.os == 'Windows' }}

- name: Rust Build
run: pnpm run build
if: ${{ !contains(matrix.os, 'windows') }}
env:
PACKAGE: "perspective-rs"
PSP_ROOT_DIR: ${{ github.workspace }}

- name: Python Build (Windows)
- name: Rust Build (Windows)
run: |
New-Item -ItemType Directory -Path $env:CARGO_TARGET_DIR -Force
pnpm run build
if: ${{ contains(matrix.os, 'windows') }}
env:
CARGO_TARGET_DIR: D:\psp-rust
PSP_ROOT_DIR: ${{ github.workspace }}
VCPKG_ROOT: ${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}
PACKAGE: "perspective-rs"

- name: Rust Test
Expand All @@ -302,7 +349,6 @@ jobs:
env:
CARGO_TARGET_DIR: D:\psp-rust
PSP_ROOT_DIR: ${{ github.workspace }}
VCPKG_ROOT: ${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}
PACKAGE: "perspective-rs"

- name: Package
Expand All @@ -323,6 +369,7 @@ jobs:
# `-'
build_emscripten_wheel:
runs-on: ${{ matrix.os }}
needs: [lint_and_docs]
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
strategy:
fail-fast: false
Expand All @@ -342,6 +389,11 @@ jobs:
id: config-step
uses: ./.github/actions/config

- uses: actions/download-artifact@v4
with:
name: perspective-metadata
path: rust/

- name: Initialize Build
id: init-step
uses: ./.github/actions/install-deps
Expand Down Expand Up @@ -470,6 +522,7 @@ jobs:

- name: Run Jupyter Tests
if: ${{ false }}
# if: ${{ runner.os == 'Linux' }}
run: |
jupyter lab --generate-config
pnpm run test --jupyter
Expand Down Expand Up @@ -509,6 +562,7 @@ jobs:
python: "false"
rust: "false"
cpp: "false"
playwright: "true"
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- uses: actions/download-artifact@v4
Expand All @@ -519,7 +573,7 @@ jobs:
- name: Run Tests
run: pnpm run test
env:
PACKAGE: "!perspective-python,!perspective-jupyterlab"
PACKAGE: "perspective-cpp,perspective,perspective-viewer,perspective-viewer-datagrid,perspective-viewer-d3fc,perspective-viewer-openlayers,perspective-workspace,perspective-cli"
# PSP_USE_CCACHE: 1

# ,--,--' . .-,--. . .
Expand Down Expand Up @@ -704,6 +758,7 @@ jobs:
benchmark_python,
build_emscripten_wheel,
build_and_test_rust,
lint_and_docs,
]
if: startsWith(github.ref, 'refs/tags/v')
strategy:
Expand Down Expand Up @@ -767,10 +822,6 @@ jobs:
with:
name: perspective-rust

# - uses: actions/download-artifact@v4
# with:
# name: perspective-python-benchmarks

- run: pnpm pack --pack-destination=../..
working-directory: ./rust/perspective-js

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,4 @@ rust/perspective-python/*.data
# rust/perspective-python/perspective.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab/package.json
rust/perspective-viewer/docs/exprtk.md
rust/perspective-server/docs/lib_gen.md
rust/perspective-client/docs/expression_gen.md
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ ts-rs/
rust/perspective-python/perspective/labextension/
rust/perspective-python/perspective.data/
rust/perspective-python/*/data
expression_gen.md
rust/perspective-viewer/docs/exprtk.md
20 changes: 16 additions & 4 deletions Cargo.lock

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

Loading

0 comments on commit 3b7559d

Please sign in to comment.