-
Notifications
You must be signed in to change notification settings - Fork 5
96 lines (75 loc) · 2.95 KB
/
Copy pathci.yml
File metadata and controls
96 lines (75 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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 -- packages/wallet-sdk/db/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 --workdir packages/wallet-sdk/db
bun supabase gen types typescript --local --schema wallet --workdir packages/wallet-sdk/db > packages/wallet-sdk/db/supabase/database.types.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet packages/wallet-sdk/db/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 run 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