Skip to content

offers deployment #2208

offers deployment

offers deployment #2208

Workflow file for this run

name: CI Pipeline
on:
pull_request:
env:
SELF_SIGNED_CERT_PATH: "../certs/ci-localhost-cert.pem"
SELF_SIGNED_CERT_KEY_PATH: "../certs/ci-localhost-key.pem"
jobs:
code-checks:
name: "Format, Lint, and Types Check"
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Environment
uses: ./.github/actions/setup-environment
- name: Run Format, Lint, and Types Check
run: bun run check:all
- name: Database Types Check
run: |
git fetch origin ${{ github.base_ref }}
MIGRATIONS_CHANGED=false
CLI_VERSION_CHANGED=false
if ! git diff --quiet origin/${{ github.base_ref }}..HEAD -- supabase/migrations/; then
MIGRATIONS_CHANGED=true
fi
if git diff origin/${{ github.base_ref }}..HEAD -- package.json | grep -qE '"supabase": "[0-9]+\.[0-9]+\.[0-9]+"'; then
CLI_VERSION_CHANGED=true
fi
if [ "$MIGRATIONS_CHANGED" = false ] && [ "$CLI_VERSION_CHANGED" = false ]; then
echo "No migration or supabase CLI version changes detected, skipping database types check."
exit 0
fi
if [ "$MIGRATIONS_CHANGED" = true ]; then
echo "Migration changes detected."
fi
if [ "$CLI_VERSION_CHANGED" = true ]; then
echo "Supabase CLI version changed."
fi
echo "Checking types..."
bun supabase db start
bun supabase gen types typescript --local --schema wallet > supabase/database.types.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet supabase/database.types.ts; then
echo "Detected uncommitted changes in database types. This means that db was changed but types were not updated. To fix regenerate the types and commit the changes. See missing types below:"
git diff
exit 1
fi
unit-tests:
name: "Unit Tests"
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Environment
uses: ./.github/actions/setup-environment
- name: Run Unit Tests
run: bun test
# e2e-tests:
# name: "E2E Tests"
# timeout-minutes: 20
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# - name: Setup Environment
# uses: ./.github/actions/setup-environment
# - name: Install Playwright Browsers
# run: bunx playwright install --with-deps
# - name: Run E2E Tests
# run: bun run test:e2e
# - uses: actions/upload-artifact@v4
# if: ${{ !cancelled() }}
# with:
# name: playwright-report
# path: playwright-report/
# retention-days: 30