#2231 move common code to vuu (#2347) #5271
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
| name: "Test UI" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| coverage: | |
| description: "Run the Chromium component coverage workflow" | |
| required: true | |
| default: false | |
| type: boolean | |
| push: | |
| branches: | |
| - "main" | |
| - "release-*" | |
| pull_request: | |
| paths: | |
| - "*" | |
| - '.github/workflows/test-ui.yml' | |
| - "vuu-ui/**" | |
| jobs: | |
| lint-and-typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| - name: Install Node & dependencies | |
| uses: ./.github/actions/setup-vuu-ui | |
| - run: cd ./vuu-ui && npm run build:worker | |
| - run: cd ./vuu-ui && npm run lint | |
| - run: cd ./vuu-ui && npm run typecheck | |
| vitest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| - name: Install Node & dependencies | |
| uses: ./.github/actions/setup-vuu-ui | |
| - run: cd ./vuu-ui && npm run test:vite | |
| playwright-gallery-build: | |
| runs-on: ubuntu-latest | |
| name: playwright-gallery-build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| - name: Install Node & dependencies | |
| uses: ./.github/actions/setup-vuu-ui | |
| - name: Build Worker | |
| run: cd ./vuu-ui && npm run build:worker | |
| - name: Build Playwright gallery | |
| env: | |
| PLAYWRIGHT_COVERAGE: ${{ inputs.coverage == true && '1' || '0' }} | |
| run: cd ./vuu-ui && npm run playwright:gallery:build | |
| - name: Upload Playwright gallery | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: playwright-gallery | |
| path: vuu-ui/playwright/gallery/dist/ | |
| retention-days: 1 | |
| playwright-component: | |
| runs-on: ubuntu-latest | |
| name: playwright-component (${{ matrix.browser }}, shard ${{ matrix.shard }}/2) | |
| needs: playwright-gallery-build | |
| strategy: | |
| matrix: | |
| browser: [chromium, firefox, webkit] | |
| shard: [1, 2] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| - name: Install Node & dependencies | |
| uses: ./.github/actions/setup-vuu-ui | |
| - name: Download Playwright gallery | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 | |
| with: | |
| name: playwright-gallery | |
| path: vuu-ui/playwright/gallery/dist | |
| - name: Build Worker | |
| run: cd ./vuu-ui && npm run build:worker | |
| - name: Install Playwright Browser | |
| run: cd ./vuu-ui && npm exec -- playwright install --with-deps ${{ matrix.browser }} | |
| - name: Run Playwright component tests | |
| env: | |
| PLAYWRIGHT_COVERAGE: ${{ inputs.coverage == true && matrix.browser == 'chromium' && '1' || '0' }} | |
| run: cd ./vuu-ui && npm exec -- playwright test --config=playwright.config.ts --project=components-${{ matrix.browser }} --shard=${{ matrix.shard }}/2 | |
| - name: Upload blob report to GitHub Actions Artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| if: always() | |
| with: | |
| name: blob-report-${{ matrix.browser }}-${{ matrix.shard }}-of-2 | |
| path: vuu-ui/blob-report/ | |
| retention-days: 10 | |
| - name: Upload Chromium coverage data | |
| if: always() && inputs.coverage == true && matrix.browser == 'chromium' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: coverage-data-${{ matrix.browser }}-${{ matrix.shard }}-of-2 | |
| path: vuu-ui/playwright/coverage-data/ | |
| retention-days: 10 | |
| playwright-merge-reports: | |
| runs-on: ubuntu-latest | |
| needs: playwright-component | |
| if: always() | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| - name: Download blob reports from GitHub Actions Artifacts | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 | |
| with: | |
| path: all-blob-reports | |
| pattern: blob-report-* | |
| merge-multiple: true | |
| - name: Download Chromium coverage data | |
| if: inputs.coverage == true | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 | |
| with: | |
| path: all-coverage-data | |
| pattern: coverage-data-* | |
| merge-multiple: true | |
| - name: Install Node & dependencies | |
| uses: ./.github/actions/setup-vuu-ui | |
| - name: Merge into HTML and JSON Reports | |
| run: PLAYWRIGHT_JSON_OUTPUT_FILE=playwright-report/test-results.json npx playwright merge-reports --reporter html,json ./all-blob-reports | |
| - name: Generate Playwright coverage report | |
| if: inputs.coverage == true | |
| run: | | |
| mkdir -p ./vuu-ui/playwright/coverage-data | |
| cp ./all-coverage-data/*.json ./vuu-ui/playwright/coverage-data/ | |
| cd ./vuu-ui && npm run playwright:coverage 2>&1 | tee -a "$GITHUB_STEP_SUMMARY" | |
| - name: Upload Playwright coverage report | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| if: always() && inputs.coverage == true | |
| with: | |
| name: playwright-coverage | |
| path: vuu-ui/playwright/coverage/ | |
| retention-days: 10 | |
| - name: Upload Merged Playwright Report | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 10 | |
| - name: Add Playwright Results to Summary | |
| if: always() | |
| run: ./.github/scripts/generate-playwright-summary.sh playwright-report/test-results.json >> $GITHUB_STEP_SUMMARY | |
| # ensure the vuu example still builds | |
| vuu-app-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| - name: Install Node & dependencies | |
| uses: ./.github/actions/setup-vuu-ui | |
| - name: Build Vuu Libraries | |
| run: cd ./vuu-ui && npm run build | |
| - name: Build Vuu app | |
| run: cd ./vuu-ui && npm run build:app |