Skip to content

wasm support, examples serving ci, on_viewport_location_change #5

wasm support, examples serving ci, on_viewport_location_change

wasm support, examples serving ci, on_viewport_location_change #5

Workflow file for this run

# generated by nickel/pr_previews.ncl; do not manually edit
jobs:
build_examples:
name: build_examples
needs: get_examples
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 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 wasm-opt nickel-lang-cli
- name: build example
run: just build_example ${{ matrix.example }}
- name: upload dist
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.example }}
path: dist
strategy:
matrix:
example: ${{ fromJson(needs.get_examples.outputs.examples) }}
deploy_examples:
name: deploy_examples
needs:
- get_examples
- build_examples
runs-on: ubuntu-latest
steps:
- name: deploy workflow
uses: ./.github/workflows/preview_deploy.yml
with:
example: ${{ matrix.example }}
parent_workflow_id: ${{ github.run_id }}
pr: ${{ github.event.number }}
strategy:
matrix:
example: ${{ fromJson(needs.get_exampless.outputs.examples) }}
deployment_comment:
name: deployment_comment
needs:
- get_examples
- deploy_examples
runs-on: ubuntu-latest
steps:
- id: deployment_timestamp
name: deployment_timestamp
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- id: links_markdown_list
name: links_markdown_list
run: |-
examples=${{ needs.get_exampless.outputs.examples }}
url_base="https://databasedav.github.io/haalka/${{ github.event.number }}/"
markdown_list=""
for example in $(echo "${examples}" | jq -r '.[]'); do
markdown_list+="\n- [$example](${url_base}${example})"
done
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.sha }}
**deployed:** ${{ steps.deployment_timestamp.outputs.timestamp }}
pr_number: ${{ github.event.number }}
get_examples:
name: get_examples
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: install just
uses: extractions/setup-just@v2
- name: output examples
run: echo "examples='$(just list_examples)'" >> $GITHUB_OUTPUT
name: pr_previews
on:
- pull_request