-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wasm support, examples serving ci, on_viewport_location_change (#6)
- Loading branch information
1 parent
105a0a9
commit d7b47e2
Showing
64 changed files
with
8,440 additions
and
791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# generated by nickel/build_and_deploy_example.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@master | ||
with: | ||
targets: wasm32-unknown-unknown | ||
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 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: JamesIves/[email protected] | ||
with: | ||
attempt-limit: 1000 | ||
commit-message: ${{ inputs.api }} ${{ inputs.example }} ${{ inputs.pr && format('https://github.com/databasedav/haalka/pull/{0}/commits/{1}', inputs.pr, github.sha) || format('https://github.com/databasedav/haalka/commit/{0}', github.sha) }} | ||
folder: dist | ||
force: false | ||
target-folder: ${{ inputs.pr && format('pr_previews/{0}/{1}/{2}', inputs.pr, inputs.api, inputs.example) || format('examples/{0}/{1}', inputs.api, inputs.example) }} | ||
name: build_and_deploy_example | ||
on: | ||
workflow_call: | ||
inputs: | ||
api: | ||
required: true | ||
type: string | ||
example: | ||
required: true | ||
type: string | ||
pr: | ||
required: false | ||
type: number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# generated by nickel/ci.ncl; do not manually edit | ||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTDOCFLAGS: --deny warnings | ||
RUSTFLAGS: --deny warnings | ||
jobs: | ||
assert_nickels_synced_: | ||
name: assert_nickels_synced_ | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: install nix | ||
uses: cachix/install-nix-action@v30 | ||
- name: nickel binary cache | ||
uses: cachix/cachix-action@v15 | ||
with: | ||
name: tweag-nickel | ||
- name: install nickel | ||
run: |- | ||
nix profile install github:tweag/nickel | ||
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH | ||
nickel --version | ||
- name: install just | ||
uses: extractions/setup-just@v2 | ||
- name: assert nickels synced | ||
run: |- | ||
just format_nickels sync_nickels | ||
[[ -n $(git status --porcelain) ]] && echo 'nickels are not synced; run `just format_nickels sync_nickels`' && exit 1 || exit 0 | ||
check_all_features: | ||
name: check_all_features | ||
needs: assert_nickels_synced_ | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: install rust toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
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 | ||
needs: assert_nickels_synced_ | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: install rust toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
components: clippy | ||
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 clippy | ||
run: just clippy | ||
docs: | ||
name: docs | ||
needs: assert_nickels_synced_ | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: install rust toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly | ||
- 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 | ||
needs: assert_nickels_synced_ | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: install rust toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
components: rustfmt | ||
toolchain: nightly | ||
- name: install just | ||
uses: extractions/setup-just@v2 | ||
- name: run format | ||
run: just format -- --check | ||
test: | ||
name: test | ||
needs: assert_nickels_synced_ | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: install rust toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
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: push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# generated by nickel/cleanup_pr_previews.ncl; do not manually edit | ||
env: | ||
PR: ${{ github.event.pull_request.number }} | ||
jobs: | ||
cleanup: | ||
name: cleanup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: make empty dir | ||
run: mkdir -p empty_dir | ||
- name: cleanup | ||
uses: JamesIves/[email protected] | ||
with: | ||
attempt-limit: 1000 | ||
commit-message: cleaning up pr preview for https://github.com/databasedav/haalka/pull/${{ env.PR }} | ||
folder: empty_dir | ||
force: false | ||
target-folder: pr_previews/${{ env.PR }} | ||
name: cleanup_pr_previews | ||
on: | ||
pull_request_target: | ||
types: | ||
- closed | ||
permissions: | ||
contents: write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# generated by nickel/examples_on_main.ncl; do not manually edit | ||
jobs: | ||
assert_nickels_synced_: | ||
name: assert_nickels_synced_ | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: install nix | ||
uses: cachix/install-nix-action@v30 | ||
- name: nickel binary cache | ||
uses: cachix/cachix-action@v15 | ||
with: | ||
name: tweag-nickel | ||
- name: install nickel | ||
run: |- | ||
nix profile install github:tweag/nickel | ||
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH | ||
nickel --version | ||
- name: install just | ||
uses: extractions/setup-just@v2 | ||
- name: assert nickels synced | ||
run: |- | ||
just format_nickels sync_nickels | ||
[[ -n $(git status --porcelain) ]] && echo 'nickels are not synced; run `just format_nickels sync_nickels`' && exit 1 || exit 0 | ||
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/build_and_deploy_example.yaml | ||
with: | ||
api: ${{ matrix.api }} | ||
example: ${{ matrix.example }} | ||
pr: '' | ||
get_examples_: | ||
name: get_examples_ | ||
needs: assert_nickels_synced_ | ||
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: examples_on_main | ||
on: | ||
push: | ||
branches: | ||
- main |
Oops, something went wrong.