Skip to content

feat: Add shareable receipts #1757

feat: Add shareable receipts

feat: Add shareable receipts #1757

Workflow file for this run

name: CI
on:
push:
branches: [master, development, 'development-*']
pull_request:
branches: [master, development, 'development-*']
env:
# cache affixes and folders
PNPM_CACHE_AFFIX: pnpm
PNPM_CACHE_FOLDER: ~/.pnpm-store
PW_CACHE_AFFIX: pw
PW_CACHE_FOLDER: ~/.cache/ms-playwright
SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING: 1
SENTRY_TELEMETRY_DISABLE: true
STORYBOOK_DISABLE_TELEMETRY: 1
jobs:
# Job to read Node version from .nvmrc
read-nvmrc:
runs-on: ubuntu-latest
outputs:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
sparse-checkout: |
.nvmrc
sparse-checkout-cone-mode: false
- name: Read .nvmrc
id: nvmrc
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
Build-And-Test:
needs: read-nvmrc
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
node-version: ['${{ needs.read-nvmrc.outputs.node-version }}']
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install package manager
uses: pnpm/action-setup@v4
# Configure pnpm store directory BEFORE setup-node tries to cache it
- name: Setup pnpm config
run: pnpm config set store-dir ${{ env.PNPM_CACHE_FOLDER }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Setup Additional Cache
uses: actions/cache@v4
id: additional_cache
with:
path: |
${{ env.PNPM_CACHE_FOLDER }}
${{ env.PW_CACHE_FOLDER }}
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/.browserslistrc') }}-${{ hashFiles('**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-
- name: Install dependencies
run: |
echo "Node version: $(node --version)"
echo "PNPM version: $(pnpm --version)"
pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Code-style
run: pnpm format:ci
- name: Test
env:
TEST_SERIAL_TIMEOUT: ${{ vars.TEST_SERIAL_TIMEOUT }}
run: |
pnpm test:ci
Sitemap-Check:
needs: read-nvmrc
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install package manager
uses: pnpm/action-setup@v4
- name: Setup pnpm config
run: pnpm config set store-dir ${{ env.PNPM_CACHE_FOLDER }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ needs.read-nvmrc.outputs.node-version }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ env.PNPM_CACHE_FOLDER }}
key: ${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate sitemap
run: pnpx tsx scripts/update-sitemap.ts
- name: Check for sitemap drift
run: git diff --exit-code public/sitemap.xml public/default-sitemap.xml public/accounts-sitemap.xml
Storybook-Smoke-Tests:
needs: read-nvmrc
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: true
strategy:
matrix:
node-version: ['${{ needs.read-nvmrc.outputs.node-version }}', '22.x']
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install package manager
uses: pnpm/action-setup@v4
- name: Setup pnpm config
run: pnpm config set store-dir ${{ env.PNPM_CACHE_FOLDER }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ env.PNPM_CACHE_FOLDER }}
key: ${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-
- name: Cache Playwright browsers
uses: actions/cache@v4
id: pw_cache
with:
path: ${{ env.PW_CACHE_FOLDER }}
key: ${{ runner.os }}-${{ env.PW_CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ env.PW_CACHE_AFFIX }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright browsers
if: steps.pw_cache.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps chromium
- name: Install Playwright system deps only
if: steps.pw_cache.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps chromium
- name: Run Storybook smoke tests
env:
STORYBOOK_DISABLE_TELEMETRY: ${{ env.STORYBOOK_DISABLE_TELEMETRY }}
run: pnpm test:sb