This repository was archived by the owner on Nov 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
107 lines (86 loc) · 3 KB
/
sqlx-updates.yml
File metadata and controls
107 lines (86 loc) · 3 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
97
98
99
100
101
102
103
104
105
106
107
on:
pull_request:
push:
branches:
- develop
- master
name: "SQLx Checks"
jobs:
sqlx_check_ws:
name: "SQLx Check (WebSocket)"
runs-on: ubuntu-latest
services:
postgres:
image: "postgres:latest"
env:
POSTGRES_PASSWORD: "postgres"
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: "checkout repo"
uses: actions/checkout@v2
- name: "install rust"
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v1
- name: "install sqlx-cli"
run: "cargo install sqlx-cli"
- name: "save current sqlx-data.json"
run: "mv sqlx-data.json sqlx-data.json.old || touch sqlx-data.json.old"
- name: "migrate db"
run: "cargo sqlx database setup"
env:
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/ferris_chat"
- name: "regenerate sqlx-data.json"
run: "cargo sqlx prepare -- --bin ws"
env:
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/ferris_chat"
- name: "assert eq, update if not eq"
run: "diff -q sqlx-data.json sqlx-data.json.old || { git config user.name github-actions; git config user.email github-actions@github.com; git add sqlx-data.json; git commit -m \"automated sqlx-data.json update\"; git push; }"
sqlx_check_http:
name: "SQLx Check (HTTP)"
runs-on: ubuntu-latest
services:
postgres:
image: "postgres:latest"
env:
POSTGRES_PASSWORD: "postgres"
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: "checkout repo"
uses: actions/checkout@v2
- name: "install rust"
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v1
- name: "install sqlx-cli"
run: "cargo install sqlx-cli"
- name: "save current sqlx-data.json"
run: "mv sqlx-data.json sqlx-data.json.old || touch sqlx-data.json.old"
- name: "migrate db"
run: "cargo sqlx database setup"
env:
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/ferris_chat"
- name: "regenerate sqlx-data.json"
run: "cargo sqlx prepare -- --bin http"
env:
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/ferris_chat"
- name: "assert eq, update if not eq"
run: "diff -q sqlx-data.json sqlx-data.json.old || { git config user.name github-actions; git config user.email github-actions@github.com; git add sqlx-data.json; git commit -m \"automated sqlx-data.json update\"; git push; }"