wasm support, examples serving ci, on_viewport_location_change #113
Workflow file for this run
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
# generated by nickel/pr_previews.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: ${{ 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<<EOF" | |
echo "$markdown_list" | |
echo "EOF" | |
} >> $GITHUB_OUTPUT | |
- uses: thollander/actions-comment-pull-request@v2 | |
with: | |
comment_tag: preview | |
message: |- | |
**commit:** https://github.com/databasedav/haalka/pull/${{ github.event.number }}/commits/${{ github.event.pull_request.head.sha }} | |
**deployed:** ${{ steps.deployment_timestamp.outputs.timestamp }} | |
**previews:** | |
${{ steps.links_markdown_list.outputs.markdown_list }} | |
mode: recreate | |
pr_number: ${{ github.event.number }} | |
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: pr_previews | |
on: pull_request |