Add frontend slides question editor with media browser #168
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: Frontend CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint-and-test-frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: app/node_modules | |
| key: ${{ runner.os }}-bun-${{ hashFiles('app/bun.lockb') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: | | |
| cd app | |
| bun install | |
| - name: Run linter | |
| run: | | |
| cd app | |
| bun run lint | |
| - name: Type check | |
| run: | | |
| cd app | |
| bun run check | |
| - name: Run tests | |
| run: | | |
| cd app | |
| bun run test | |
| - name: Build | |
| run: | | |
| cd app | |
| bun run build | |
| test-end-to-end: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: 'service/.python-version' | |
| - name: Install backend dependencies | |
| run: | | |
| cd service | |
| uv sync --all-extras | |
| - name: Run Django migrations | |
| run: | | |
| cd service | |
| uv run python manage.py migrate | |
| - name: Cache frontend dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: app/node_modules | |
| key: ${{ runner.os }}-bun-${{ hashFiles('app/bun.lockb') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install frontend dependencies | |
| run: | | |
| cd app | |
| bun install | |
| - name: Cache Playwright browsers | |
| id: playwright-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('app/bun.lockb') }} | |
| restore-keys: | | |
| ${{ runner.os }}-playwright- | |
| - name: Install Playwright browsers | |
| run: | | |
| cd app | |
| bunx playwright install chromium | |
| - name: Install Playwright system dependencies | |
| run: | | |
| cd app | |
| bunx playwright install-deps chromium | |
| - name: Run E2E tests | |
| run: | | |
| cd app | |
| bun run test:e2e | |
| env: | |
| CI: true | |
| - name: Upload test artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: | | |
| app/playwright-report/ | |
| app/test-results/ | |
| retention-days: 7 | |
| # To download: Go to the workflow run page, scroll to "Artifacts" section at the bottom |