diff --git a/.github/workflows/report-fork.yml b/.github/workflows/report-fork.yml index e35ec77b..40238f58 100644 --- a/.github/workflows/report-fork.yml +++ b/.github/workflows/report-fork.yml @@ -1,4 +1,5 @@ name: Example report - fork +run-name: "${{ inputs.fork }}:${{ inputs.branch }}" on: workflow_dispatch: @@ -20,8 +21,7 @@ jobs: name: Get Environment runs-on: ubuntu-latest outputs: - pages: ${{ steps.env.outputs.pages }} - per-pages: ${{ env.PER_PAGE }} + per_page: ${{ env.PER_PAGE }} gitref: ${{ steps.env.outputs.gitref }} date: ${{ steps.env.outputs.date }} pixeleagle_project: ${{ steps.env.outputs.pixeleagle_project }} @@ -34,42 +34,40 @@ jobs: - name: Get Environment id: env run: | - example_count=`cat Cargo.toml | grep '\[\[example\]\]' | wc -l` - page_count=$((example_count / ${{ env.PER_PAGE }} + 1)) - echo "gitref=`git rev-parse HEAD`" >> $GITHUB_OUTPUT echo "date=`date +%Y%m%d%H%M`" >> $GITHUB_OUTPUT - echo "pages=`python -c \"import json; print(json.dumps([i for i in range($page_count)]))\"`" >> $GITHUB_OUTPUT echo "pixeleagle_project=B25A040A-A980-4602-B90C-D480AB84076D" >> $GITHUB_OUTPUT native-run: + name: Native needs: [get-environment] uses: ./.github/workflows/workflow-native.yml with: gitref: ${{ needs.get-environment.outputs.gitref }} pixeleagle_project: ${{ needs.get-environment.outputs.pixeleagle_project }} - branch: "${{ inputs.fork }} - ${{ inputs.branch }}" + branch: "${{ inputs.fork }}:${{ inputs.branch }}" repository: ${{ inputs.fork }} - pages: ${{ needs.get-environment.outputs.pages }} - per-page: ${{ needs.get-environment.outputs.per-pages }} + per_page: "${{ needs.get-environment.outputs.per_page }}" secrets: inherit mobile-run: + name: Mobile needs: [get-environment] uses: ./.github/workflows/workflow-mobile.yml with: gitref: ${{ needs.get-environment.outputs.gitref }} pixeleagle_project: ${{ needs.get-environment.outputs.pixeleagle_project }} - branch: "${{ inputs.fork }} - ${{ inputs.branch }}" + branch: "${{ inputs.fork }}:${{ inputs.branch }}" repository: ${{ inputs.fork }} secrets: inherit wasm-run: + name: wasm needs: [get-environment] uses: ./.github/workflows/workflow-wasm.yml with: gitref: ${{ needs.get-environment.outputs.gitref }} pixeleagle_project: ${{ needs.get-environment.outputs.pixeleagle_project }} - branch: "${{ inputs.fork }} - ${{ inputs.branch }}" + branch: "${{ inputs.fork }}:${{ inputs.branch }}" repository: ${{ inputs.fork }} secrets: inherit diff --git a/.github/workflows/report-pr.yml b/.github/workflows/report-pr.yml index 2eeb12b5..0fdcc790 100644 --- a/.github/workflows/report-pr.yml +++ b/.github/workflows/report-pr.yml @@ -1,4 +1,5 @@ name: Example report - PR +run-name: ${{ inputs.pr }} on: workflow_dispatch: @@ -16,8 +17,7 @@ jobs: name: Get Environment runs-on: ubuntu-latest outputs: - pages: ${{ steps.env.outputs.pages }} - per-pages: ${{ env.PER_PAGE }} + per_page: ${{ env.PER_PAGE }} gitref: ${{ steps.env.outputs.gitref }} date: ${{ steps.env.outputs.date }} pixeleagle_project: ${{ steps.env.outputs.pixeleagle_project }} @@ -33,15 +33,12 @@ jobs: - name: Get Environment id: env run: | - example_count=`cat Cargo.toml | grep '\[\[example\]\]' | wc -l` - page_count=$((example_count / ${{ env.PER_PAGE }} + 1)) - echo "gitref=`git rev-parse HEAD`" >> $GITHUB_OUTPUT echo "date=`date +%Y%m%d%H%M`" >> $GITHUB_OUTPUT - echo "pages=`python -c \"import json; print(json.dumps([i for i in range($page_count)]))\"`" >> $GITHUB_OUTPUT echo "pixeleagle_project=B25A040A-A980-4602-B90C-D480AB84076D" >> $GITHUB_OUTPUT native-run: + name: Native needs: [get-environment] uses: ./.github/workflows/workflow-native.yml with: @@ -49,11 +46,11 @@ jobs: pixeleagle_project: ${{ needs.get-environment.outputs.pixeleagle_project }} branch: "PR-${{ inputs.pr }}" repository: "bevyengine/bevy" - pages: ${{ needs.get-environment.outputs.pages }} - per-page: ${{ needs.get-environment.outputs.per-pages }} + per_page: "${{ needs.get-environment.outputs.per_page }}" secrets: inherit mobile-run: + name: Mobile needs: [get-environment] uses: ./.github/workflows/workflow-mobile.yml with: @@ -64,6 +61,7 @@ jobs: secrets: inherit wasm-run: + name: wasm needs: [get-environment] uses: ./.github/workflows/workflow-wasm.yml with: diff --git a/.github/workflows/workflow-mobile.yml b/.github/workflows/workflow-mobile.yml index bcf64ea2..a37990eb 100644 --- a/.github/workflows/workflow-mobile.yml +++ b/.github/workflows/workflow-mobile.yml @@ -80,7 +80,7 @@ jobs: -F "file=@target/debug/apk/bevyexample.apk" \ -F "custom_id=$GITHUB_RUN_ID" - mobile-run: + take-screenshots: runs-on: ubuntu-latest timeout-minutes: 30 needs: [build-for-iOS, build-for-Android] @@ -181,7 +181,7 @@ jobs: mobile-check-result: runs-on: ubuntu-latest timeout-minutes: 30 - needs: [mobile-run] + needs: [take-screenshots] if: always() steps: - name: Wait for screenshots comparison diff --git a/.github/workflows/workflow-native.yml b/.github/workflows/workflow-native.yml index b5e29b72..00086f82 100644 --- a/.github/workflows/workflow-native.yml +++ b/.github/workflows/workflow-native.yml @@ -6,6 +6,7 @@ on: repository: required: true type: string + default: 'bevyengine/bevy' gitref: required: true type: string @@ -15,25 +16,42 @@ on: branch: required: true type: string - per-page: - required: true - type: number - pages: + default: 'main' + per_page: required: true type: string jobs: + split-pages: + name: Prepare pages + runs-on: ubuntu-latest + outputs: + pages: ${{ steps.env.outputs.pages }} + steps: + - name: Checkout Bevy + uses: actions/checkout@v4 + with: + repository: ${{ inputs.repository}} + ref: ${{ inputs.gitref }} + - name: Prepare Pages + id: env + run: | + example_count=`cat Cargo.toml | grep '\[\[example\]\]' | wc -l` + page_count=$((example_count / ${{ inputs.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: [split-pages] runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-14] - page: ${{ fromJSON(inputs.pages) }} + page: ${{ fromJSON(needs.split-pages.outputs.pages) }} steps: - - name: Checkout Bevy main branch + - name: Checkout Bevy uses: actions/checkout@v4 with: repository: ${{ inputs.repository }} @@ -96,7 +114,7 @@ jobs: id: screenshots-linux if: runner.os == 'linux' continue-on-error: true - run: xvfb-run -s "-screen 0 1280x1024x24" cargo run -p example-showcase -- --page ${{ matrix.page }} --per-page ${{ inputs.per-page }} run --screenshot-at 400 --frame-duration 0.0125 --stop-at 450 --in-ci --ignore-stress-tests --report-details + run: xvfb-run -s "-screen 0 1280x1024x24" cargo run -p example-showcase -- --page ${{ matrix.page }} --per-page ${{ inputs.per_page }} run --screenshot-at 400 --frame-duration 0.0125 --stop-at 450 --in-ci --ignore-stress-tests --report-details - name: Take Screenshots (Windows) id: screenshots-windows @@ -108,13 +126,13 @@ jobs: $screen = [System.Windows.Forms.SystemInformation]::VirtualScreen [Windows.Forms.Cursor]::Position = "$($screen.Width / 2),$($screen.Height / 2)" - cargo run -p example-showcase -- --page ${{ matrix.page }} --per-page ${{ inputs.per-page }} run --screenshot-at 400 --frame-duration 0.0125 --stop-at 450 --in-ci --ignore-stress-tests --report-details + cargo run -p example-showcase -- --page ${{ matrix.page }} --per-page ${{ inputs.per_page }} run --screenshot-at 400 --frame-duration 0.0125 --stop-at 450 --in-ci --ignore-stress-tests --report-details - name: Take Screenshots (macOS) id: screenshots-macos if: runner.os == 'macos' continue-on-error: true - run: cargo run -p example-showcase -- --page ${{ matrix.page }} --per-page ${{ inputs.per-page }} run --screenshot-at 400 --frame-duration 0.0125 --stop-at 450 --in-ci --ignore-stress-tests --report-details + run: cargo run -p example-showcase -- --page ${{ matrix.page }} --per-page ${{ inputs.per_page }} run --screenshot-at 400 --frame-duration 0.0125 --stop-at 450 --in-ci --ignore-stress-tests --report-details - name: Log errors shell: pwsh