test,ci: validate version of sqlite and fix ci

This commit is contained in:
oxalica 2024-09-17 22:49:43 -04:00
parent 4108212f34
commit 7b0ca8aa16
2 changed files with 22 additions and 2 deletions

View file

@ -39,15 +39,20 @@ jobs:
test:
strategy:
fail-fast: false
matrix:
rust: [stable, beta]
name: Test ${{ matrix.rust }}
runs-on: ubuntu-latest
# Need libsqlite3-dev >= 3.38.0 (2022-02-22)
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install sqlite
run: sudo apt-get install --no-install-recommends -y libsqlite3-dev
- name: Disable high-priority rust-toolchain.toml
run: rm rust-toolchain.toml
@ -67,7 +72,11 @@ jobs:
run: cargo build --workspace --all-targets
- name: Test
run: cargo test --workspace --all-targets -- --include-ignored
run: cargo test --workspace --all-targets
# WAIT: Next release of `criterion` for `--include-ignored`.
- name: Test ignored
run: cargo test --workspace --all-targets -- --ignored
nix-flake:
name: Flake package

View file

@ -131,4 +131,15 @@ impl ConnectionExt for Connection {}
fn init_sql_valid() {
let conn = Connection::open_in_memory().unwrap();
conn.execute_batch(INIT_SQL).unwrap();
// Instantiate view to check syntax and availability of `unixepoch()`.
// It requires sqlite >= 3.38.0 (2022-02-22) which is not available by default on GitHub CI.
let ret = conn
.query_row(
"SELECT COUNT(*) FROM `valid_user_act_key`",
params![],
|row| row.get::<_, i64>(0),
)
.unwrap();
assert_eq!(ret, 0);
}