Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm support, examples serving ci, on_viewport_location_change #6

Open
wants to merge 64 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
b6426ec
check
databasedav Oct 19, 2024
84b2c51
check
databasedav Nov 5, 2024
7233b4c
check
databasedav Nov 7, 2024
11cf078
check
databasedav Nov 9, 2024
295c3d8
check
databasedav Nov 9, 2024
1c8051f
check
databasedav Nov 10, 2024
56d4ece
check
databasedav Nov 12, 2024
2ad4f01
check
databasedav Nov 16, 2024
e85e8e7
check
databasedav Nov 16, 2024
4a09160
check
databasedav Nov 16, 2024
91a2873
check
databasedav Nov 16, 2024
d1867dd
check
databasedav Nov 16, 2024
a1afcb6
check
databasedav Nov 16, 2024
52241aa
check
databasedav Nov 16, 2024
8d441ff
check
databasedav Nov 16, 2024
1e1c76d
check
databasedav Nov 16, 2024
49b98cf
check
databasedav Nov 16, 2024
518e4a8
check
databasedav Nov 16, 2024
94fe1e6
check
databasedav Nov 16, 2024
be01ada
check
databasedav Nov 16, 2024
f8292cd
check
databasedav Nov 16, 2024
ab4ea38
check
databasedav Nov 16, 2024
a76d066
check
databasedav Nov 16, 2024
e2b2b83
check
databasedav Nov 16, 2024
f94e71b
check
databasedav Nov 16, 2024
0de2505
check
databasedav Nov 16, 2024
c14708c
check
databasedav Nov 16, 2024
cb3e590
check
databasedav Nov 16, 2024
af0e112
check
databasedav Nov 16, 2024
479493d
check
databasedav Nov 16, 2024
9d4a862
check
databasedav Nov 16, 2024
aac2be1
check
databasedav Nov 16, 2024
530d8fe
check
databasedav Nov 16, 2024
17da2f2
check
databasedav Nov 16, 2024
38187cc
check
databasedav Nov 16, 2024
7b82ea7
check
databasedav Nov 16, 2024
7f6d114
check
databasedav Nov 16, 2024
1d7f743
check
databasedav Nov 16, 2024
0cc4dc8
check
databasedav Nov 16, 2024
24b7aa0
check
databasedav Nov 16, 2024
67b2ca0
check
databasedav Nov 16, 2024
48724e2
check
databasedav Nov 16, 2024
c219dcf
check
databasedav Nov 16, 2024
884f0e6
check
databasedav Nov 16, 2024
119d93d
check
databasedav Nov 16, 2024
f9fd913
check
databasedav Nov 16, 2024
b87e0ba
check
databasedav Nov 16, 2024
e1aaa5c
check
databasedav Nov 16, 2024
76dc883
check
databasedav Nov 16, 2024
ac5a812
check
databasedav Nov 16, 2024
30313a1
check
databasedav Nov 16, 2024
af25e5b
check
databasedav Nov 16, 2024
18a1994
check
databasedav Nov 16, 2024
dc3f67d
check
databasedav Nov 19, 2024
ef421f9
check
databasedav Nov 19, 2024
802f08d
check
databasedav Nov 19, 2024
42b4fe2
check
databasedav Nov 19, 2024
612df57
check
databasedav Nov 19, 2024
34869da
check
databasedav Nov 19, 2024
8aea792
check
databasedav Nov 19, 2024
2f70372
check
databasedav Nov 19, 2024
8eafc7f
check
databasedav Nov 19, 2024
79551df
check
databasedav Nov 19, 2024
b4c3432
check
databasedav Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[.github/workflows/*.yaml]
indent_size = 2

[*.ncl]
indent_size = 2
120 changes: 120 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# generated by nickel/ci.ncl; do not manually edit
env:
CARGO_TERM_COLOR: always
RUSTDOCFLAGS: --deny warnings
RUSTFLAGS: --deny warnings
jobs:
check_all_features:
name: check_all_features
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: install bevy dependencies
run: sudo apt-get update && sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
shell: bash
- name: populated target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: install just
uses: extractions/setup-just@v2
- name: install binstall
uses: cargo-bins/cargo-binstall@main
- name: install cargo all features
run: cargo binstall --no-confirm cargo-all-features
- name: check all features
run: just check_all_features
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: install bevy dependencies
run: sudo apt-get update && sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
shell: bash
- name: populated target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: install just
uses: extractions/setup-just@v2
- name: run clippy
run: just clippy
docs:
name: docs
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: install bevy dependencies
run: sudo apt-get update && sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
shell: bash
- name: populated target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: install just
uses: extractions/setup-just@v2
- name: check docs
run: just doc
format:
name: format
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: install rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: install just
uses: extractions/setup-just@v2
- name: run format
run: just format -- --check
test:
name: test
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: install bevy dependencies
run: sudo apt-get update && sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
shell: bash
- name: populated target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: install just
uses: extractions/setup-just@v2
- name: run tests
run: just test
name: ci
on:
pull_request:
branches:
- main
push:
branches:
- main
74 changes: 74 additions & 0 deletions .github/workflows/pr_previews.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# generated by nickel/pr_previews.ncl; do not manually edit
jobs:
build_and_deploy_examples:
name: build_and_deploy_examples
needs: get_examples
permissions:
contents: write
strategy:
matrix:
api:
- webgl2
- webgpu
example: ${{ fromJson(needs.get_examples.outputs.examples) }}
uses: ./.github/workflows/preview_build_deploy.yaml
with:
api: ${{ matrix.api }}
example: ${{ matrix.example }}
pr: ${{ github.event.number }}
deployment_comment:
name: deployment_comment
needs:
- get_examples
- build_and_deploy_examples
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- id: deployment_timestamp
name: deployment_timestamp
run: |-
timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo "timestamp=$timestamp"
echo "timestamp=$timestamp" >> $GITHUB_OUTPUT
- id: links_markdown_list
name: links_markdown_list
run: |-
examples='${{ needs.get_examples.outputs.examples }}'
base_url="https://databasedav.github.io/haalka/pr_previews/${{ github.event.number }}"
markdown_list=""
for example in $(echo "${examples}" | jq -r '.[]'); do
markdown_list="${markdown_list}- $example: [webgl2](${base_url}/webgl2/${example}) [webgpu](${base_url}/webgpu/${example})"$'\n'
done
echo "markdown_list=$markdown_list"
echo "markdown_list=$markdown_list" >> $GITHUB_OUTPUT
- uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: preview
message: |-
**previews:**
${{ steps.links_markdown_list.outputs.markdown_list }}
**commit:** https://github.com/databasedav/haalka/pull/${{ github.event.number }}/commits/${{ github.event.pull_request.head.sha }}
**deployed:** ${{ steps.deployment_timestamp.outputs.timestamp }}
pr_number: ${{ github.event.number }}
get_examples:
name: get_examples
outputs:
examples: ${{ steps.output_examples.outputs.examples }}
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: install just
uses: extractions/setup-just@v2
- id: output_examples
name: output_examples
run: |-
examples=$(just list_examples)
echo "examples=$examples"
echo "examples=$examples" >> $GITHUB_OUTPUT
name: pr_previews
on:
- pull_request
81 changes: 81 additions & 0 deletions .github/workflows/preview_build_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# generated by nickel/preview_build_deploy.ncl; do not manually edit
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: install bevy dependencies
run: sudo apt-get update && sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
shell: bash
- name: populated target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: install just
uses: extractions/setup-just@v2
- name: install binstall
uses: cargo-bins/cargo-binstall@main
- name: install trunk
run: |-
wget https://github.com/databasedav/trunk/releases/download/v0.0.1/trunk
chmod +x trunk
mv trunk /usr/local/bin
- name: install build dependencies
run: cargo binstall --no-confirm wasm-bindgen-cli wasm-opt nickel-lang-cli
- if: ${{ inputs.api == 'webgl2' }}
name: build example
run: just build_wasm_example ${{ inputs.example }}
- if: ${{ inputs.api == 'webgpu' }}
name: build example
run: just build_wasm_example ${{ inputs.example }} webgpu
- name: upload dist
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.api }}_${{ inputs.example }}
path: dist
deploy:
name: deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: remove gitignore
run: rm .gitignore
- name: download dist
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ inputs.api }}_${{ inputs.example }}
path: dist
- name: deploy
uses: databasedav/github-pages-deploy-action@ec82a366a3ef75d20483861daeedcdb2c09a3fd5
with:
attempt-limit: 1000
commit-message: https://github.com/databasedav/haalka/pull/${{ inputs.pr }}/commits/${{ github.sha }}
folder: dist
force: false
target-folder: '"pr_previews/${{ inputs.pr }}/${{ inputs.api }}/${{ inputs.example }}"'
name: preview_build_deploy
on:
workflow_call:
inputs:
api:
required: true
type: string
example:
required: true
type: string
pr:
required: true
type: number
36 changes: 0 additions & 36 deletions .github/workflows/release-plz.yaml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# generated by nickel/release.ncl; do not manually edit
env:
CARGO_TERM_COLOR: always
RUSTDOCFLAGS: --deny warnings
RUSTFLAGS: --deny warnings
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: install bevy dependencies
run: sudo apt-get update && sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
shell: bash
- name: populated target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: run release-plz
uses: MarcoIeni/[email protected]
with:
command: release
name: release
on:
pull_request:
branches:
- main
paths:
- release/**
types:
- closed
permissions:
contents: write
pull-requests: write
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target
/Cargo.lock
target
test.ncl
index.html
dist
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// "rust-analyzer.cargo.target": "wasm32-unknown-unknown",
// "rust-analyzer.cargo.noDefaultFeatures": true,
"rust-analyzer.cargo.features": [],
"filewatcher.commands": [
{
"match": ".*.ncl$",
// need to suppress stderr output, because otherwise file watcher extension complains
"cmd": "cd haalka && just sync_nickels 2> /dev/null",
"event": "onFileChange"
}
]
}
Loading
Loading