Skip to content

Test Examples (Flake Detection) #10

Test Examples (Flake Detection)

Test Examples (Flake Detection) #10

Workflow file for this run

name: Test Examples (Flake Detection)
on:
workflow_dispatch:
env:
YARN_ENABLE_GLOBAL_CACHE: false
jobs:
test_examples:
name: Example Tests (Run ${{ matrix.run }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
run: [1, 2, 3, 4, 5]
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run:
echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v5
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install
- name: Install Playwright Browsers
run: corepack yarn workspace @uppy/dashboard playwright install --with-deps
- name: Build
run: corepack yarn run build
- name: Run all example tests in parallel
run: |
corepack yarn workspace example-react test --browser.headless > /tmp/react.log 2>&1 &
REACT_PID=$!
corepack yarn workspace example-vue test --browser.headless > /tmp/vue.log 2>&1 &
VUE_PID=$!
corepack yarn workspace example-sveltekit test --browser.headless > /tmp/svelte.log 2>&1 &
SVELTE_PID=$!
REACT_EXIT=0; VUE_EXIT=0; SVELTE_EXIT=0
wait $REACT_PID || REACT_EXIT=$?
wait $VUE_PID || VUE_EXIT=$?
wait $SVELTE_PID || SVELTE_EXIT=$?
echo "## Run ${{ matrix.run }} Results" >> $GITHUB_STEP_SUMMARY
echo "| Framework | Exit Code | Result |" >> $GITHUB_STEP_SUMMARY
echo "|-----------|-----------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| React | $REACT_EXIT | $([ $REACT_EXIT -eq 0 ] && echo 'PASS' || echo 'FAIL') |" >> $GITHUB_STEP_SUMMARY
echo "| Vue | $VUE_EXIT | $([ $VUE_EXIT -eq 0 ] && echo 'PASS' || echo 'FAIL') |" >> $GITHUB_STEP_SUMMARY
echo "| SvelteKit | $SVELTE_EXIT | $([ $SVELTE_EXIT -eq 0 ] && echo 'PASS' || echo 'FAIL') |" >> $GITHUB_STEP_SUMMARY
echo ""
echo "=== React output ==="
cat /tmp/react.log
echo ""
echo "=== Vue output ==="
cat /tmp/vue.log
echo ""
echo "=== SvelteKit output ==="
cat /tmp/svelte.log
if [ $REACT_EXIT -ne 0 ] || [ $VUE_EXIT -ne 0 ] || [ $SVELTE_EXIT -ne 0 ]; then
exit 1
fi