Skip to content

Commit 96fc973

Browse files
committed
fix: resolve bug causing CI errors
1 parent 72c7f58 commit 96fc973

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

.github/workflows/rust.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,35 @@ jobs:
115115
- name: Build crate doc
116116
run: cargo doc --no-deps
117117

118+
unix-sqlx-mysql-test:
119+
strategy:
120+
matrix:
121+
os:
122+
- ubuntu-latest
123+
- macos-latest
124+
runs-on: ${{matrix.os}}
125+
env:
126+
CARGO_TEST_MYSQL_PASSWORD: password
127+
128+
steps:
129+
- uses: actions/checkout@v3
130+
- uses: shogo82148/actions-setup-mysql@v1
131+
with:
132+
mysql-version: "5.7"
133+
root-password: "password"
134+
my-cnf: |
135+
skip-ssl
136+
port=3306
137+
- name: ulimit -n
138+
run: ulimit -n 65535
139+
- name: Run tests for macOS
140+
if: runner.os == 'macOS'
141+
run: cargo test --features storage_sqlx --lib --bins --tests --verbose
142+
- name: Run tests for non-macOS
143+
if: runner.os != 'macOS'
144+
run: cargo test --features storage_sqlx --verbose
145+
- name: Build crate doc
146+
run: cargo doc --no-deps
118147

119148
windows-default-test:
120149
strategy:
@@ -182,3 +211,45 @@ jobs:
182211
run: cargo test --features storage_mysql --verbose
183212
- name: Build crate doc
184213
run: cargo doc --no-deps
214+
215+
windows-sqlx-mysql-test:
216+
strategy:
217+
matrix:
218+
os:
219+
- windows-latest
220+
runs-on: ${{matrix.os}}
221+
env:
222+
CARGO_TEST_MYSQL_PASSWORD: password
223+
224+
steps:
225+
- uses: actions/checkout@v3
226+
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
227+
- name: install openssl
228+
run: vcpkg install openssl:x64-windows-static-md
229+
- name: Download MySQL Connector/C
230+
run: |
231+
Invoke-WebRequest -Uri "https://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.11-winx64.msi" -OutFile "mysql-connector.msi"
232+
- name: Install MySQL Connector/C
233+
run: |
234+
Start-Process msiexec.exe -ArgumentList '/i', 'mysql-connector.msi', '/quiet', '/norestart' -NoNewWindow -Wait
235+
- name: Set MySQLCLIENT_LIB_DIR
236+
run: echo "MYSQLCLIENT_LIB_DIR=C:\Program Files\MySQL\MySQL Connector C 6.1\lib\vs14" | Out-File -FilePath $env:GITHUB_ENV -Append
237+
- name: Set MYSQLCLIENT_VERSION
238+
run: echo "MYSQLCLIENT_VERSION=8.4.0" | Out-File -FilePath $env:GITHUB_ENV -Append
239+
- uses: shogo82148/actions-setup-mysql@v1
240+
with:
241+
mysql-version: "5.7"
242+
root-password: "password"
243+
my-cnf: |
244+
skip-ssl
245+
port=3306
246+
- name: Setup Rust
247+
uses: actions-rs/toolchain@v1
248+
with:
249+
toolchain: stable
250+
- name: Build
251+
run: cargo build --features storage_sqlx --verbose
252+
- name: Run tests
253+
run: cargo test --features storage_sqlx --verbose
254+
- name: Build crate doc
255+
run: cargo doc --no-deps

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ openssl-sys = { git = "https://github.com/Tongsuo-Project/rust-tongsuo.git" }
9696
toml = "0.8.19"
9797

9898
[features]
99-
default = ["crypto_adaptor_openssl", "storage_sqlx"]
99+
default = ["crypto_adaptor_openssl"]
100100
storage_sqlx = ["sqlx"]
101101
storage_mysql = ["diesel", "r2d2", "r2d2-diesel"]
102102
crypto_adaptor_openssl = ["dep:openssl", "dep:openssl-sys"]

0 commit comments

Comments
 (0)