File tree Expand file tree Collapse file tree 4 files changed +23
-17
lines changed Expand file tree Collapse file tree 4 files changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -17,13 +17,10 @@ concurrency:
17
17
18
18
jobs :
19
19
build :
20
- strategy :
21
- fail-fast : false
22
- matrix :
23
- os : [ubuntu-latest]
24
- crystal : ["1.15.1"]
20
+ runs-on : ubuntu-latest
21
+ container :
22
+ image : crystallang/crystal:1.15.1
25
23
26
- runs-on : ${{ matrix.os }}
27
24
services :
28
25
postgres :
29
26
image : postgres
@@ -39,12 +36,11 @@ jobs:
39
36
--health-timeout=5s
40
37
--health-retries=5
41
38
steps :
42
- - name : Download source
43
- uses : actions/checkout@v4
44
- - name : Install Crystal
45
- uses : crystal-lang/install-crystal@v1
46
- with :
47
- crystal : ${{ matrix.crystal }}
39
+ - uses : actions/checkout@v4
40
+ - name : Update package list and install SQLite and development files
41
+ run : |
42
+ apt-get update
43
+ apt-get install -y sqlite3 libsqlite3-dev
48
44
- name : Verify SQLite installation
49
45
run : sqlite3 --version
50
46
- name : Create SQLite databases
62
58
- name : Check formatting
63
59
run : crystal tool format --check
64
60
- name : Check code linting with Ameba
65
- run : bin/ameba --fix -f progress
61
+ run : bin/ameba
62
+ - name : Wait for Postgres
63
+ run : |
64
+ for i in {1..30}; do
65
+ pg_isready -h postgres -U example && break
66
+ echo "Waiting for postgres..."
67
+ sleep 1
68
+ done
66
69
- name : Run tests
67
70
env :
68
71
DATABASE_URL : postgres://example:example@postgres:5432/example
Original file line number Diff line number Diff line change 1
1
name : cql
2
- version : 0.0.162
2
+ version : 0.0.176
3
3
authors :
4
4
5
5
crystal : ' >= 1.12.2'
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ describe CQL::Schema do
50
50
.into(:customers )
51
51
.values(
52
52
name: customer.name,
53
+ email: customer.email,
53
54
city: customer.city,
54
55
balance: customer.balance
55
56
).commit
@@ -68,6 +69,7 @@ describe CQL::Schema do
68
69
.into(:customers )
69
70
.values(
70
71
name: customer.name,
72
+ email: customer.email,
71
73
city: customer.city,
72
74
balance: customer.balance
73
75
).commit
@@ -78,7 +80,7 @@ describe CQL::Schema do
78
80
79
81
it " creates a schema" do
80
82
Data .tables.size.should eq(2 )
81
- Data .tables[:customers ].columns.size.should eq(6 )
83
+ Data .tables[:customers ].columns.size.should eq(7 )
82
84
end
83
85
84
86
it " add a column to an existing table" do
@@ -90,7 +92,7 @@ describe CQL::Schema do
90
92
end
91
93
92
94
column_exists.call(:country , :customers ).should eq(1 )
93
- Data .tables[:customers ].columns.size.should eq(7 )
95
+ Data .tables[:customers ].columns.size.should eq(8 )
94
96
end
95
97
96
98
it " drops a column from an existing table" do
@@ -104,7 +106,7 @@ describe CQL::Schema do
104
106
end
105
107
106
108
column_exists.call(:city , :customers ).should eq(0 )
107
- Data .tables[:customers ].columns.size.should eq(6 )
109
+ Data .tables[:customers ].columns.size.should eq(7 )
108
110
end
109
111
110
112
it " adds an index to a table" do
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Data = CQL::Schema.define(
5
5
table :customers do
6
6
primary :id , Int32
7
7
column :name , String
8
+ column :email , String
8
9
column :city , String
9
10
column :balance , Int32
10
11
timestamps
You can’t perform that action at this time.
0 commit comments