-
Notifications
You must be signed in to change notification settings - Fork 10
62 lines (55 loc) · 1.71 KB
/
supabase_migration.yml
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
name: Run Supabase Migration Test
on:
push:
branches:
- main
paths:
- postgres/migrations/**
- postgres/benches/**
pull_request:
branches:
- main
paths:
- postgres/migrations/**
- postgres/benches/**
jobs:
migrations:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create .env file
run: |
touch .env.ci
echo SUPABASE_DB=${{ secrets.SUPABASE_DB }} >> .env.ci
echo SUPABASE_DB_USER=${{ secrets.SUPABASE_DB_USER }} >> .env.ci
echo SUPABASE_DB_PORT=${{ secrets.SUPABASE_DB_PORT }} >> .env.ci
echo SUPABASE_DB_PASSWORD=${{ secrets.SUPABASE_DB_PASSWORD }} >> .env.ci
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
AppFlowy-Supabase/postgres
cache-all-crates: true
- name: Run all up migrations
run: |
cargo run database reset .env.ci no-verify
- name: Run migration tests
working-directory: ./postgres/migrations_tests
env:
PGHOST: ${{ secrets.SUPABASE_DB }}
PGPORT: ${{ secrets.SUPABASE_DB_PORT }}
PGUSER: ${{ secrets.SUPABASE_DB_USER }}
PGPASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
PGDB: postgres
run: |
./check
./af_user
./af_collab_update
- name: Run benchmark (insert into af_collab_update)
working-directory: ./postgres
env:
PGHOST: ${{ secrets.SUPABASE_DB }}
PGPORT: ${{ secrets.SUPABASE_DB_PORT }}
PGUSER: ${{ secrets.SUPABASE_DB_USER }}
PGPASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
run: cargo bench