@@ -10,131 +10,109 @@ on:
10
10
- main
11
11
12
12
jobs :
13
- # rust:
14
- # runs-on: ubuntu-latest
15
- # container: ubuntu:20.04
16
- # services:
17
- # # Label used to access the service container
18
- # postgres:
19
- # # Docker Hub image
20
- # image: postgres
21
- # env:
22
- # POSTGRES_PASSWORD: postgres
23
- # # Set health checks to wait until postgres has started
24
- # options: >-
25
- # --health-cmd pg_isready
26
- # --health-interval 10s
27
- # --health-timeout 5s
28
- # --health-retries 5
29
- # # mysql
30
- # mysql:
31
- # image: ghcr.io/wangxiaoying/mysql:latest
32
- # env:
33
- # MYSQL_DATABASE: mysql
34
- # MYSQL_ROOT_PASSWORD: mysql
35
- # LANG: C.UTF-8
36
- # ports:
37
- # - 3306:3306
38
- # options: >-
39
- # --health-cmd "mysqladmin ping"
40
- # --health-interval 10s
41
- # --health-timeout 10s
42
- # --health-retries 5
43
- # mssql:
44
- # image: mcr.microsoft.com/mssql/server:2019-latest
45
- # env:
46
- # ACCEPT_EULA: y
47
- # SA_PASSWORD: mssql!Password
48
- # ports:
49
- # - 1433:1433
50
- # options: >-
51
- # --health-cmd "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P \"$SA_PASSWORD\" -Q 'SELECT 1' || exit 1"
52
- # --health-interval 10s
53
- # --health-timeout 5s
54
- # --health-retries 20
55
- # steps:
56
- # - uses: actions/checkout@v4
13
+ rust :
14
+ runs-on : ubuntu-latest
15
+ container : ubuntu:22.04
16
+ services :
17
+ postgres :
18
+ image : postgres
19
+ env :
20
+ POSTGRES_PASSWORD : postgres
21
+ # Set health checks to wait until postgres has started
22
+ options : >-
23
+ --health-cmd pg_isready
24
+ --health-interval 10s
25
+ --health-timeout 5s
26
+ --health-retries 5
27
+ mysql :
28
+ image : ghcr.io/wangxiaoying/mysql:latest
29
+ env :
30
+ MYSQL_DATABASE : mysql
31
+ MYSQL_ROOT_PASSWORD : mysql
32
+ LANG : C.UTF-8
33
+ ports :
34
+ - 3306:3306
35
+ options : >-
36
+ --health-cmd "mysqladmin ping"
37
+ --health-interval 10s
38
+ --health-timeout 10s
39
+ --health-retries 5
57
40
58
- # - name: Install tools
59
- # run: |
60
- # apt-get update
61
- # apt-get install -y curl postgresql-client build-essential pkg-config libssl-dev git sqlite3 libsqlite3-dev mysql-client python3 python3-pip libicu66 libkrb5-dev libclang-dev
62
- # pip3 install mssql-cli
63
- # pip3 install cli-helpers==2.2.0
64
- # ln -s /usr/bin/ python3 /usr/bin/python
65
- # echo "Cache Version ${{ secrets.CACHE_VERSION }}"
66
- # env:
67
- # DEBIAN_FRONTEND: noninteractive
41
+ steps :
42
+ - uses : actions/checkout@v4
43
+
44
+ - name : Install tools
45
+ run : |
46
+ apt-get update
47
+ apt-get install -y curl postgresql-client build-essential pkg-config libssl-dev git sqlite3 libsqlite3-dev mysql-client python3 python3-pip libkrb5-dev libclang-dev
48
+ echo "Cache Version ${{ secrets.CACHE_VERSION }}"
49
+ env :
50
+ DEBIAN_FRONTEND : noninteractive
68
51
69
- # - name: Install Rust
70
- # uses: actions-rs/toolchain@v1
71
- # with:
72
- # toolchain: stable
73
- # components: rustfmt
74
- # default: true
52
+ - name : Install Rust
53
+ uses : actions-rs/toolchain@v1
54
+ with :
55
+ toolchain : stable
56
+ components : rustfmt
57
+ default : true
75
58
76
- # - uses: actions/cache@v4
77
- # with:
78
- # path: |
79
- # ~/.cargo/bin/
80
- # ~/.cargo/registry/index/
81
- # ~/.cargo/registry/cache/
82
- # ~/.cargo/git/db/
83
- # target/
84
- # key: ${{ runner.os }}-cargo-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
59
+ - uses : actions/cache@v4
60
+ with :
61
+ path : |
62
+ ~/.cargo/bin/
63
+ ~/.cargo/registry/index/
64
+ ~/.cargo/registry/cache/
65
+ ~/.cargo/git/db/
66
+ target/
67
+ key : ${{ runner.os }}-cargo-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
85
68
86
- # - name: Install other dependent tools
87
- # run: |
88
- # if [ ! -f "$HOME/.cargo/bin/just" ]; then curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/.cargo/bin; fi
69
+ - uses : extractions/setup-just@v2
89
70
90
- # - name: Seed the database
91
- # run: just seed-db
92
- # env:
93
- # POSTGRES_URL: "postgresql://postgres:postgres@postgres:5432/postgres"
94
- # SQLITE_URL: "sqlite:///tmp/test.db"
95
- # MYSQL_HOST: mysql
96
- # MYSQL_PORT: 3306
97
- # MYSQL_DB: mysql
98
- # MYSQL_USER: root
99
- # MYSQL_PASSWORD: mysql
100
- # MSSQL_HOST: mssql
101
- # MSSQL_PORT: 1433
102
- # MSSQL_DB: tempdb
103
- # MSSQL_USER: sa
104
- # MSSQL_PASSWORD: mssql!Password
71
+ - name : Seed the database
72
+ run : just seed-db
73
+ env :
74
+ POSTGRES_URL : " postgresql://postgres:postgres@postgres:5432/postgres"
75
+ SQLITE_URL : " sqlite:///tmp/test.db"
76
+ MYSQL_HOST : mysql
77
+ MYSQL_PORT : 3306
78
+ MYSQL_DB : mysql
79
+ MYSQL_USER : root
80
+ MYSQL_PASSWORD : mysql
105
81
106
- # - name: Is the code formatted?
107
- # uses: actions-rs/cargo@v1
108
- # with:
109
- # command: fmt
110
- # args: --all -- --check -q
82
+ - name : Is the code formatted?
83
+ uses : actions-rs/cargo@v1
84
+ with :
85
+ command : fmt
86
+ args : --all -- --check -q
111
87
112
- # - name: Clippy linting
113
- # uses: actions-rs/cargo@v1
114
- # with:
115
- # command: clippy
116
- # args: --features all
88
+ - name : Clippy linting
89
+ uses : actions-rs/cargo@v1
90
+ with :
91
+ command : clippy
92
+ args : --features all
117
93
118
- # - name: Check each feature gate
119
- # run: just test-feature-gate
94
+ - name : Check each feature gate
95
+ run : just test-feature-gate
120
96
121
- # - name: Run tests
122
- # run: cargo clean && just test
123
- # env:
124
- # POSTGRES_URL: "postgresql://postgres:postgres@postgres:5432/postgres"
125
- # SQLITE_URL: "sqlite:///tmp/test.db"
126
- # MYSQL_URL: "mysql://root:mysql@mysql:3306/mysql"
127
- # MSSQL_URL: "mssql://sa:mssql!Password@mssql:1433/tempdb"
97
+ - name : Run tests
98
+ run : cargo clean && just test
99
+ env :
100
+ POSTGRES_URL : " postgresql://postgres:postgres@postgres:5432/postgres"
101
+ SQLITE_URL : " sqlite:///tmp/test.db"
102
+ MYSQL_URL : " mysql://root:mysql@mysql:3306/mysql"
128
103
129
- # - name: Test build docs
130
- # uses: actions-rs/cargo@v1
131
- # with:
132
- # command: doc
133
- # args: --no-deps --features all
104
+ - name : Test build docs
105
+ uses : actions-rs/cargo@v1
106
+ with :
107
+ command : doc
108
+ args : --no-deps --features all
134
109
135
110
python :
136
111
runs-on : ubuntu-latest
137
- container : ubuntu:20.04
112
+ container : ubuntu:22.04
113
+ strategy :
114
+ matrix :
115
+ python-version : ["3.12"]
138
116
services :
139
117
# Label used to access the service container
140
118
postgres :
@@ -162,32 +140,33 @@ jobs:
162
140
--health-interval 10s
163
141
--health-timeout 10s
164
142
--health-retries 5
165
- mssql :
166
- image : mcr.microsoft.com/mssql/server:2019-latest
167
- env :
168
- ACCEPT_EULA : y
169
- SA_PASSWORD : mssql!Password
170
- ports :
171
- - 1433:1433
172
- options : >-
173
- --health-cmd "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P \"$SA_PASSWORD\" -Q 'SELECT 1' || exit 1"
174
- --health-interval 10s
175
- --health-timeout 5s
176
- --health-retries 20
177
143
178
144
steps :
179
145
- uses : actions/checkout@v4
180
146
147
+ - uses : actions/setup-python@v5
148
+ with :
149
+ python-version : ${{ matrix.python-version }}
150
+ - name : Setup python env
151
+ run : |
152
+ which python
153
+ which pip
154
+ # ln -s `which python` /usr/bin/python
155
+ # ln -s `which pip` /usr/bin/pip
156
+ echo "$Python3_ROOT_DIR/bin" >> $GITHUB_PATH
157
+ echo $GITHUB_PATH
158
+
181
159
- name : Install tools
182
160
run : |
183
161
apt-get update
184
- apt-get install -y curl postgresql-client build-essential python3-dev python3-pip pkg-config libssl-dev git sqlite3 libsqlite3-dev mysql-client libmysqlclient-dev python3 python3-pip libicu66 libkrb5-dev libclang-dev
185
- pip3 install mssql-cli
186
- pip3 install cli-helpers==2.2.0
187
- ln -s /usr/bin/python3 /usr/bin/python
162
+ apt-get install -y wget curl postgresql-client build-essential pkg-config libssl-dev git sqlite3 libsqlite3-dev mysql-client libmysqlclient-dev libkrb5-dev libclang-dev
188
163
env :
189
164
DEBIAN_FRONTEND : noninteractive
190
165
166
+ - uses : Gr1N/setup-poetry@v9
167
+
168
+ - uses : extractions/setup-just@v2
169
+
191
170
- name : Install Rust
192
171
uses : actions-rs/toolchain@v1
193
172
with :
@@ -208,12 +187,7 @@ jobs:
208
187
~/.cargo/registry/cache/
209
188
~/.cargo/git/db/
210
189
target/
211
- key : ${{ runner.os }}-cargo-python-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
212
-
213
- - name : Install other dependent tools
214
- run : |
215
- pip3 install poetry
216
- if [ ! -f "$HOME/.cargo/bin/just" ]; then curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/.cargo/bin; fi
190
+ key : ${{ runner.os }}-cargo-python-${{ matrix.python-version }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
217
191
218
192
- name : Seed the database
219
193
run : just seed-db
@@ -225,11 +199,6 @@ jobs:
225
199
MYSQL_DB : mysql
226
200
MYSQL_USER : root
227
201
MYSQL_PASSWORD : mysql
228
- MSSQL_HOST : mssql
229
- MSSQL_PORT : 1433
230
- MSSQL_DB : tempdb
231
- MSSQL_USER : sa
232
- MSSQL_PASSWORD : mssql!Password
233
202
234
203
- name : Clippy linting
235
204
uses : actions-rs/cargo@v1
@@ -241,18 +210,16 @@ jobs:
241
210
uses : actions/cache@v4
242
211
with :
243
212
path : ~/.cache/pypoetry/virtualenvs
244
- key : ${{ runner.os }}-venv-${{ secrets.CACHE_VERSION }}-${{ hashFiles('connectorx-python/poetry.lock') }}
213
+ key : ${{ runner.os }}-${{ matrix.python-version }}- venv-${{ secrets.CACHE_VERSION }}-${{ hashFiles('connectorx-python/poetry.lock') }}
245
214
246
- - name : Install python dependencies
247
- run : just bootstrap-python
215
+ - uses : extractions/setup-just@v2
248
216
249
217
- name : Test python
250
218
run : just test-python
251
219
env :
252
220
POSTGRES_URL : " postgresql://postgres:postgres@postgres:5432/postgres"
253
221
SQLITE_URL : " sqlite:///tmp/test.db"
254
222
MYSQL_URL : " mysql://root:mysql@mysql:3306/mysql"
255
- MSSQL_URL : " mssql://sa:mssql!Password@mssql:1433/tempdb"
256
223
DB1 : " postgresql://postgres:postgres@postgres:5432/postgres"
257
224
DB2 : " postgresql://postgres:postgres@postgres:5432/postgres"
258
225
FED_CONFIG_PATH : ${{ github.workspace }}/.github/config
0 commit comments