Production wiring: GDevelop master, hourly schedule, notifications #15
Workflow file for this run
This file contains hidden or 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
| # Plays every in-app tutorial against the GDevelop editor (web build, master | |
| # branch) and fails if a tutorial step cannot be completed. A video of each | |
| # tutorial being played is uploaded as an artifact, for passing and failing | |
| # runs alike. | |
| # | |
| # Runs on every push (a tutorial change should not break the tutorials) and | |
| # every hour (a change in GDevelop master should not either). The hourly | |
| # schedule only runs from the default branch (main). | |
| name: Test in-app tutorials | |
| on: | |
| push: | |
| branches: [main, automatic-tests] | |
| schedule: | |
| # Every hour: GDevelop pushes do not trigger this workflow, the schedule | |
| # catches editor changes that break tutorials. | |
| - cron: '17 * * * *' | |
| workflow_dispatch: | |
| jobs: | |
| test-in-app-tutorials: | |
| # One job per editor layout (see the projects in e2e/playwright.config.js): | |
| # they run in parallel and each uploads its own videos. | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| project: [desktop, tablet, mobile] | |
| name: test-in-app-tutorials (${{ matrix.project }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - name: Checkout tutorials | |
| uses: actions/checkout@v4 | |
| - name: Checkout GDevelop | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 4ian/GDevelop | |
| ref: master | |
| path: GDevelop | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: | | |
| package-lock.json | |
| GDevelop/newIDE/app/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install GDevelop editor dependencies | |
| run: npm ci | |
| working-directory: GDevelop/newIDE/app | |
| # Fast static check: every selector used by the tutorials must still | |
| # exist in the editor sources. Known broken tutorials are skipped — | |
| # remove them from --ignore (and from KNOWN_BROKEN_TUTORIAL_IDS in | |
| # e2e/in-app-tutorials.spec.js) once fixed. | |
| - name: Check tutorial selectors against the editor sources | |
| if: matrix.project == 'desktop' | |
| run: npm run check-in-app-tutorial-selectors -- --gdevelop-root-path ./GDevelop --ignore flingGame | |
| - name: Install Playwright browser | |
| run: npx playwright install --with-deps chromium | |
| # Starts the editor dev server (from ./GDevelop) and plays every | |
| # tutorial. Known broken tutorials are expected to fail. | |
| - name: Play all in-app tutorials | |
| run: npm run test-in-app-tutorials -- --project=${{ matrix.project }} | |
| # Playwright records webm, which does not play natively on macOS: | |
| # convert to mp4 (H.264) so the videos open with QuickTime/Quick Look. | |
| - name: Convert videos to mp4 | |
| if: always() | |
| run: | | |
| sudo apt-get update -qq && sudo apt-get install -y -qq ffmpeg | |
| find test-results -name "*.webm" -print0 | while IFS= read -r -d '' file; do | |
| ffmpeg -nostdin -y -loglevel error -i "$file" -c:v libx264 -preset veryfast -crf 28 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -movflags +faststart "${file%.webm}.mp4" && rm "$file" | |
| done | |
| - name: Upload videos and screenshots | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tutorial-videos-${{ matrix.project }} | |
| path: | | |
| test-results/**/*.mp4 | |
| test-results/**/*.png | |
| test-results/**/error-context.md | |
| # Hourly runs would accumulate a lot of videos: keep them shorter. | |
| retention-days: ${{ github.event_name == 'schedule' && 3 || 14 }} | |
| if-no-files-found: warn | |
| # Traces are heavy (~50MB per failed test, with a DOM snapshot of every | |
| # action): uploaded separately so downloading the videos stays fast. | |
| # Inspect with: npx playwright show-trace trace.zip | |
| - name: Upload traces (failures only) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-traces-${{ matrix.project }} | |
| path: test-results/**/trace.zip | |
| retention-days: ${{ github.event_name == 'schedule' && 3 || 14 }} | |
| if-no-files-found: ignore | |
| # Ping the team when tutorials are broken. Requires the | |
| # TUTORIALS_CI_DISCORD_WEBHOOK secret (a Discord webhook URL) to be set | |
| # on the repository; does nothing otherwise. | |
| - name: Notify failure | |
| if: failure() | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.TUTORIALS_CI_DISCORD_WEBHOOK }} | |
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| PROJECT: ${{ matrix.project }} | |
| run: | | |
| if [ -n "$DISCORD_WEBHOOK_URL" ]; then | |
| curl -sS -H "Content-Type: application/json" \ | |
| -d "{\"content\": \"❌ In-app tutorials are broken on the $PROJECT layout: $RUN_URL\"}" \ | |
| "$DISCORD_WEBHOOK_URL" | |
| fi |