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 examples: update the GitHub actions #1124

Merged
merged 4 commits into from Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 20 additions & 14 deletions .github/workflows/build-wasm-examples.yml
Expand Up @@ -7,13 +7,31 @@ env:
PER_PAGE: 50

jobs:
prepare-pages:
name: Get Pages
runs-on: ubuntu-latest
outputs:
pages: ${{ steps.pages.outputs.pages }}
steps:
- name: Checkout Bevy main branch
uses: actions/checkout@v4
with:
repository: 'bevyengine/bevy'
ref: 'latest'
- name: Get Pages
id: pages
run: |
example_count=`cat Cargo.toml | grep '\[\[example\]\]' | wc -l`
page_count=$((example_count / ${{ env.PER_PAGE }} + 1))
echo "pages=`python -c \"import json; print(json.dumps([i for i in range($page_count)]))\"`" >> $GITHUB_OUTPUT
mockersf marked this conversation as resolved.
Show resolved Hide resolved

wasm-examples:
name: Build WASM Examples
needs: prepare-pages
runs-on: macos-latest
strategy:
matrix:
# if all examples are not built, add a new page here
page: [0, 1, 2]
page: ${{ fromJSON(needs.prepare-pages.outputs.pages) }}
api: [webgl2, webgpu]
steps:

Expand All @@ -23,18 +41,6 @@ jobs:
repository: 'bevyengine/bevy'
ref: 'latest'

# temporary: fetch tools from main branch
- name: Checkout Bevy Tools
uses: actions/checkout@v4
with:
repository: 'bevyengine/bevy'
ref: 'main'
path: 'bevy-tools'
- name: Copy Bevy tools to latest
run: |
cp -r bevy-tools/tools/ tools
rm -rf bevy-tools

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/update-screenshots.yml
Expand Up @@ -7,13 +7,31 @@ env:
PER_PAGE: 20

jobs:
prepare-pages:
name: Get Pages
runs-on: ubuntu-latest
outputs:
pages: ${{ steps.pages.outputs.pages }}
steps:
- name: Checkout Bevy main branch
uses: actions/checkout@v4
with:
repository: 'bevyengine/bevy'
ref: 'latest'
- name: Get Pages
id: pages
run: |
example_count=`cat Cargo.toml | grep '\[\[example\]\]' | wc -l`
page_count=$((example_count / ${{ env.PER_PAGE }} + 1))
echo "pages=`python -c \"import json; print(json.dumps([i for i in range($page_count)]))\"`" >> $GITHUB_OUTPUT

take-screenshots:
name: Take Screenshots
needs: prepare-pages
runs-on: ubuntu-latest
strategy:
matrix:
# if all examples are not built, add a new page here
page: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
page: ${{ fromJSON(needs.prepare-pages.outputs.pages) }}
steps:

- name: Checkout Bevy latest tag
Expand Down