fix(frontend): profile photo form upload (#10331) #1
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: AutoGPT Platform - Frontend CI | |
| on: | |
| push: | |
| branches: [master, dev] | |
| paths: | |
| - ".github/workflows/platform-frontend-ci.yml" | |
| - "autogpt_platform/frontend/**" | |
| pull_request: | |
| paths: | |
| - ".github/workflows/platform-frontend-ci.yml" | |
| - "autogpt_platform/frontend/**" | |
| merge_group: | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: autogpt_platform/frontend | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| cache-key: ${{ steps.cache-key.outputs.key }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "21" | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Generate cache key | |
| id: cache-key | |
| run: echo "key=${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ steps.cache-key.outputs.key }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| lint: | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "21" | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ needs.setup.outputs.cache-key }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run lint | |
| run: pnpm lint | |
| type-check: | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "21" | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ needs.setup.outputs.cache-key }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run tsc check | |
| run: pnpm type-check | |
| chromatic: | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| # Only run on dev branch pushes or PRs targeting dev | |
| if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "21" | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ needs.setup.outputs.cache-key }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Chromatic | |
| uses: chromaui/action@latest | |
| with: | |
| projectToken: chpt_9e7c1a76478c9c8 | |
| onlyChanged: true | |
| workingDir: autogpt_platform/frontend | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| browser: [chromium, webkit] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "21" | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| large-packages: false # slow | |
| docker-images: false # limited benefit | |
| - name: Copy default supabase .env | |
| run: | | |
| cp ../.env.example ../.env | |
| - name: Copy backend .env | |
| run: | | |
| cp ../backend/.env.example ../backend/.env | |
| - name: Run docker compose | |
| run: | | |
| docker compose -f ../docker-compose.yml up -d | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ needs.setup.outputs.cache-key }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Setup .env | |
| run: cp .env.example .env | |
| - name: Build frontend | |
| run: pnpm build --turbo | |
| # uses Turbopack, much faster and safe enough for a test pipeline | |
| - name: Install Browser '${{ matrix.browser }}' | |
| run: pnpm playwright install --with-deps ${{ matrix.browser }} | |
| - name: Run Playwright tests | |
| run: pnpm test:no-build --project=${{ matrix.browser }} | |
| env: | |
| BROWSER_TYPE: ${{ matrix.browser }} | |
| - name: Print Final Docker Compose logs | |
| if: always() | |
| run: docker compose -f ../docker-compose.yml logs | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report-${{ matrix.browser }} | |
| path: playwright-report/ | |
| retention-days: 30 |