Unify design system: receipt theme refactor #124
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: Tests | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| security-events: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| REDIS_URL: redis://localhost:6379 | |
| NEXT_PUBLIC_POSTHOG_KEY: test-key | |
| NEXT_PUBLIC_POSTHOG_HOST: https://app.posthog.com | |
| OCR_PROVIDER: google | |
| GOOGLE_API_KEY: placeholder | |
| NODE_ENV: test | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run linter | |
| run: pnpm lint | |
| - name: Run type check | |
| run: pnpm typecheck | |
| - name: Run tests with coverage | |
| run: pnpm test:ci | |
| - name: Upload coverage reports to Codecov | |
| continue-on-error: true | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./coverage/lcov.info | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| - name: Comment PR with coverage | |
| if: github.event_name == 'pull_request' | |
| continue-on-error: true | |
| uses: romeovs/[email protected] | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| lcov-file: ./coverage/lcov.info | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| services: | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run integration tests | |
| env: | |
| REDIS_URL: redis://localhost:6379 | |
| NODE_ENV: test | |
| run: pnpm test -- --testPathPatterns=integration --passWithNoTests | |
| - name: Build application | |
| run: pnpm build | |
| security-scan: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| # Will skip gracefully if SNYK_TOKEN is not available (continue-on-error is set below) | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Snyk to check for vulnerabilities | |
| uses: snyk/actions/node@master | |
| continue-on-error: true | |
| env: | |
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
| with: | |
| args: --severity-threshold=high --sarif-file-output=snyk.sarif | |
| command: test | |
| - name: Upload Snyk results to GitHub Code Scanning | |
| continue-on-error: true | |
| uses: github/codeql-action/upload-sarif@v3 | |
| if: always() && hashFiles('snyk.sarif') != '' | |
| with: | |
| sarif_file: snyk.sarif |