Skip to content

feat: implement dictionary-passing for user-defined typeclasses (E.39) #60

feat: implement dictionary-passing for user-defined typeclasses (E.39)

feat: implement dictionary-passing for user-defined typeclasses (E.39) #60

Workflow file for this run

name: Build and Deploy Playground
# Rebuild playground WASM when any dependency changes.
# Keep paths in sync with: grep "^bhc-" crates/bhc-playground/Cargo.toml
on:
push:
branches: [main]
paths:
# The playground crate itself
- 'crates/bhc-playground/**'
# All dependencies (from bhc-playground/Cargo.toml)
- 'crates/bhc-span/**'
- 'crates/bhc-intern/**'
- 'crates/bhc-index/**'
- 'crates/bhc-arena/**'
- 'crates/bhc-data-structures/**'
- 'crates/bhc-diagnostics/**'
- 'crates/bhc-lexer/**'
- 'crates/bhc-ast/**'
- 'crates/bhc-parser/**'
- 'crates/bhc-types/**'
- 'crates/bhc-hir/**'
- 'crates/bhc-lower/**'
- 'crates/bhc-typeck/**'
- 'crates/bhc-core/**'
- 'crates/bhc-hir-to-core/**'
- 'crates/bhc-session/**'
workflow_dispatch: # Allow manual trigger
env:
CARGO_TERM_COLOR: always
jobs:
build-playground:
runs-on: ubuntu-latest
steps:
- name: Checkout bhc
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Add WASM target
run: rustup target add wasm32-unknown-unknown
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-playground-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-playground-
- name: Install wasm-bindgen
run: cargo install wasm-bindgen-cli --version 0.2.108 --force
- name: Build playground WASM
run: cargo build -p bhc-playground --target wasm32-unknown-unknown --release
- name: Generate JS bindings
run: |
mkdir -p playground-out
wasm-bindgen --out-dir playground-out --target web \
target/wasm32-unknown-unknown/release/bhc_playground.wasm
- name: Checkout website repo
uses: actions/checkout@v4
with:
repository: raskell-io/bhc.raskell.io
path: website
token: ${{ secrets.DOCS_DEPLOY_TOKEN2 }}
- name: Update playground files
run: |
cp playground-out/bhc_playground.js website/static/playground/
cp playground-out/bhc_playground_bg.wasm website/static/playground/
- name: Commit and push
run: |
cd website
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add static/playground
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update playground WASM from bhc@${{ github.sha }}"
git push
fi