Skip to content

Commit

Permalink
various CI fixes
Browse files Browse the repository at this point in the history
build.rs was missing an `await`, plus sqlx seems prone to build-time "database
is locked" errors for reasons I haven't had time to debug, so I'm downgrading to
0.5.13 for the time being.
  • Loading branch information
dicej committed Jun 25, 2022
1 parent c6bc81c commit 303d791
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 37 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Install gexiv2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgexiv2-dev
sudo apt-get install -y libgexiv2-dev ffmpeg
- name: Clippy
run: cargo clippy --all-features --all-targets
run: cargo clippy --release --all-features --all-targets
- name: Run tests
run: cargo test --release
run: cargo test --release --all-features --all-targets
49 changes: 20 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ serde = "1.0.137"
serde_derive = "1.0.137"
serde_json = "1.0.81"
sha2 = "0.10.2"
sqlx = { version = "0.6.0", features = [ "runtime-tokio-native-tls", "sqlite" ] }
sqlx = { version = "0.5.13", features = [ "runtime-tokio-native-tls", "sqlite" ] }
structopt = "0.3.26"
thiserror = "1.0.31"
ring = "0.16.20"
Expand All @@ -48,5 +48,5 @@ maplit = "1.0.2"
[build-dependencies]
anyhow = "1.0.58"
schema = { path = "./schema" }
sqlx = { version = "0.6.0", features = [ "runtime-tokio-native-tls", "sqlite" ] }
sqlx = { version = "0.5.13", features = [ "runtime-tokio-native-tls", "sqlite" ] }
tokio = { version = "1.19.2", features = [ "macros", "rt-multi-thread", "fs" ] }
6 changes: 4 additions & 2 deletions server/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use {
anyhow::{anyhow, Result},
sqlx::{sqlite::SqliteConnectOptions, ConnectOptions},
sqlx::{sqlite::SqliteConnectOptions, ConnectOptions, Connection as _},
std::env,
tokio::fs,
};
Expand All @@ -10,7 +10,7 @@ async fn main() -> Result<()> {
let mut path = env::current_dir()?;
path.push("target");

let _ = fs::create_dir(&path);
let _ = fs::create_dir(&path).await;

path.push("schema.dat");

Expand All @@ -28,6 +28,8 @@ async fn main() -> Result<()> {
sqlx::query(statement).execute(&mut conn).await?;
}

conn.close().await?;

println!("cargo:rustc-env=DATABASE_URL=sqlite://{db}");

Ok(())
Expand Down

0 comments on commit 303d791

Please sign in to comment.