Skip to content

Commit

Permalink
merge: main -> ext-environment-representation
Browse files Browse the repository at this point in the history
  • Loading branch information
jens-hj committed Apr 8, 2024
2 parents 4f51abd + 7ce1ce9 commit 2296fc6
Show file tree
Hide file tree
Showing 149 changed files with 9,659 additions and 3,474 deletions.
18 changes: 13 additions & 5 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Recommended by bevy: https://bevyengine.org/learn/book/getting-started/setup/
[target.x86_64-unknown-linux-gnu]
linker = "clang"
## TODO: the path to mold is not right when using nix
# rustflags = ["-C", "link-arg=-fuse-ld=mold"]
# rustflags = ["-C", "linker=mold"]
## rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"]
# linker = "clang"
rustflags = [
"-Clink-arg=-fuse-ld=mold", # Use mold Linker
# "-Zshare-generics=y", # (Nightly) Make the current crate share its generic instantiations
# "-Zthreads=0", # (Nightly) Use improved multithreading with the recommended amount of threads.
]

# compile simulation as a wasm binary for static webpage
[target.wasm32-unknown-unknown]
# runner = "wasm-server-runner"
rustflags = [
"--cfg=web_sys_unstable_apis",
]

[build]
rustflags = [
"-Clink-arg=-fuse-ld=mold",
]
73 changes: 73 additions & 0 deletions .github/workflows/deploy-page.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: deploy-github-page

on: [workflow_dispatch]
# on: [push, workflow_dispatch]
# workflow_dispatch:

permissions:
contents: write

# defaults:
# run:
# shell: bash
# working-directory: crates/gbpplanner-rs

jobs:
install-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: install apt dependencies
run: sudo apt-get update; sudo apt-get install -y pkg-config libx11-dev libasound2-dev libudev-dev # libfreetype6-dev libfontconfig1-dev

- name: install mold linker
uses: rui314/setup-mold@v1

- name: install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
# targets: wasm32-unknown-unknown
toolchain: stable

- name: Add wasm target
run: rustup target add wasm32-unknown-unknown

- name: install trunk
uses: jetli/trunk-action@v0.5.0
with:
version: 'latest'

# build-wasm-binary:
# working-directory: crates/gbpplanner-rs
# runs-on: ubuntu-latest
# needs: [install-dependencies]

# steps:

- name: Build wasm binary
run: |
trunk build --release --public-url /${{ github.event.repository.name }}
working-directory: crates/gbpplanner-rs

- name: optimize Wasm
uses: NiklasEi/wasm-opt-action@v2
# working-directory: crates/gbpplanner-rs
with:
# file: dist/*.wasm
file: ./crates/gbpplanner-rs/dist/*.wasm

# deploy-to-github-pages:
# working-directory: crates/gbpplanner-rs
# runs-on: ubuntu-latest
# needs: [build-wasm-binary]
# steps:
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.2.5
# working-directory: crates/gbpplanner-rs
with:
branch: gh-pages
single-commit: true
# folder: ./dist
folder: ./crates/gbpplanner-rs/dist
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/target
.direnv/
**/dist/
*.wasm

*.log
# pixi environments
Expand Down
Loading

0 comments on commit 2296fc6

Please sign in to comment.