Merge pull request #374 from danieloche635-bit/fix/364-366-369-372-so… #284
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: Lint, Test & Build | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| ui: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ui }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Detect UI changes | |
| if: github.event_name == 'pull_request' | |
| id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| ui: | |
| - 'components/**' | |
| - 'src/app/layout.tsx' | |
| - 'src/app/globals.css' | |
| - 'src/app/stream/new/**' | |
| - 'src/lib/theme.tsx' | |
| - 'e2e/visual-regression.spec.ts' | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run lint | |
| - name: Unit tests | |
| run: npm run test:run | |
| - name: Build | |
| run: npm run build | |
| env: | |
| NEXT_PUBLIC_STELLAR_NETWORK: testnet | |
| NEXT_PUBLIC_CONTRACT_ID: CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM | |
| a11y: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Accessibility audit (axe-core) | |
| run: npm run a11y | |
| env: | |
| NEXT_PUBLIC_STELLAR_NETWORK: testnet | |
| NEXT_PUBLIC_CONTRACT_ID: CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM | |
| - name: Upload a11y report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: a11y-report | |
| path: playwright-report-a11y/ | |
| visual-regression: | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.ui == 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Visual regression test | |
| run: npx playwright test e2e/visual-regression.spec.ts --project=chromium | |
| env: | |
| NEXT_PUBLIC_STELLAR_NETWORK: testnet | |
| NEXT_PUBLIC_CONTRACT_ID: CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM |