forked from juspay/hyperswitch
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (72 loc) · 2.26 KB
/
migration-check.yaml
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
name: Migration Consistency Tests
on:
pull_request:
merge_group:
types:
- checks_requested
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Allow more retries for network requests in cargo (downloading crates) and
# rustup (installing toolchains). This should help to reduce flaky CI failures
# from transient network timeouts or other issues.
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
# Use cargo's sparse index protocol
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
jobs:
migration_verify:
name: Verify consistency of migrations with `schema.rs` file
runs-on: ubuntu-latest
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/hyperswitch_db
PGUSER: postgres
PGPASSWORD: postgres
PGHOST: localhost
PGPORT: 5432
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable 2 weeks ago
- uses: baptiste0928/[email protected]
with:
crate: diesel_cli
features: postgres
args: "--no-default-features"
- uses: baptiste0928/[email protected]
with:
crate: just
- name: Create database
shell: bash
run: just resurrect hyperswitch_db
- name: Verify `diesel migration run for v1`
shell: bash
run: just migrate run --locked-schema
- name: Verify `diesel migration redo for v1`
shell: bash
run: just migrate redo --locked-schema --all
- name: Drop `DB for v2 column ordering mismatch`
shell: bash
run: just resurrect hyperswitch_db
- name: Verify `diesel migration run for v2`
shell: bash
run: just migrate_v2 run --locked-schema
- name: Verify `diesel migration redo for v2`
shell: bash
run: just migrate_v2 redo --locked-schema --all