chore: remove outdated root vitest config #35
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
| // Yoni: This file should be part of example app | ||
| name: Collect Test Data | ||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| test-and-collect: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: pnpm/action-setup@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: 'pnpm' | ||
| - name: Install dependencies | ||
| run: pnpm install | ||
| - name: Run tests | ||
| working-directory: apps/example-app | ||
| run: pnpm test:ci || true | ||
| - name: Parse JUnit to JSON | ||
| working-directory: apps/example-app | ||
| env: | ||
| PR_NUMBER: ${{ github.event.pull_request.number || '0' }} | ||
| GITHUB_SHA: ${{ github.sha }} | ||
| run: pnpm parse-junit test-results.xml test-data.json | ||
| - name: Commit to data branch | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| # Fetch or create data branch | ||
| git fetch origin gh-data || true | ||
| git checkout gh-data || git checkout --orphan gh-data | ||
| # Clean and copy data | ||
| mkdir -p data | ||
| cp apps/example-app/test-data.json "data/$(date +%Y-%m-%d)_${GITHUB_SHA:0:7}.json" | ||
| # Create index.json with list of all files | ||
| ls data/*.json | sed 's|data/||' | jq -R -s 'split("\n") | map(select(length > 0))' > data/index.json | ||
| # Commit and push | ||
| git add data/ | ||
| git commit -m "Add test data for ${GITHUB_SHA:0:7}" || echo "No changes" | ||
| git push origin gh-data | ||