Skip to content

Commit

Permalink
compute the number of pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Mar 20, 2024
1 parent 031aed7 commit e8ccfb4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/build-wasm-examples.yml
Expand Up @@ -7,13 +7,30 @@ 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))
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 Down
21 changes: 19 additions & 2 deletions .github/workflows/update-screenshots.yml
Expand Up @@ -7,13 +7,30 @@ 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))
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

0 comments on commit e8ccfb4

Please sign in to comment.