Skip to content

Commit 61df1f6

Browse files
committed
Update CI
1 parent 94f186a commit 61df1f6

4 files changed

Lines changed: 17 additions & 14 deletions

File tree

.github/workflows/rust.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust
1+
name: DocSense CI
22

33
on:
44
push:
@@ -16,7 +16,6 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818

19-
# Caching deps before build
2019
- name: Cache Cargo dependencies
2120
uses: actions/cache@v4
2221
with:
@@ -35,7 +34,21 @@ jobs:
3534
override: true
3635

3736
- name: Install system dependencies
38-
run: sudo apt-get update && sudo apt-get install -y libcairo2-dev libglib2.0-dev pkg-config
37+
run: |
38+
sudo apt-get update
39+
sudo apt-get install -y libpoppler-glib-dev pkg-config
40+
PKG_PATH=$(dpkg -L libpoppler-glib-dev | grep 'poppler-glib.pc' || true)
41+
echo "Found poppler-glib.pc at: $PKG_PATH"
42+
if [ -z "$PKG_PATH" ]; then
43+
echo "ERROR: poppler-glib.pc not found!" && exit 1
44+
fi
45+
export PKG_CONFIG_PATH=$(dirname $PKG_PATH)
46+
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
47+
48+
- name: Verify pkg-config
49+
run: |
50+
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}"
51+
pkg-config --modversion poppler-glib
3952
4053
- name: Build (Debug)
4154
run: cargo build --verbose

src/lexer.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ impl<'a> Lexer<'a> {
5959
return Some(stemmed_token);
6060
}
6161

62-
// // Ignore single-character unwanted punctuation
63-
// let unwanted_symbols = &[',', ';', '*', '/', '?', '{', '}', '(', ')', '.', '$', '_', '-'];
64-
65-
// if unwanted_symbols.contains(&self.content[0]) {
66-
// self.chop(1); // skip this token
67-
// return self.next_token(); // recursively fetch next token
68-
// }
69-
7062
let token = self.chop(1);
7163
return Some(token.iter().collect());
7264
}

src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ fn parse_pdf_files(file_path: &Path) -> Result<String, ()> {
6464
eprintln!("{}: Failed to make poppler document out of PDF file {path} as {err}", "ERROR".red().bold(), path = file_path.to_string_lossy().bright_blue(), err = err.to_string().red());
6565
})?;
6666

67-
6867
let mut content = String::new();
6968
if pdf_file.n_pages() > 0 {
7069
for i in 0..pdf_file.n_pages() {

src/model.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::{
2-
fs, path::{Path, PathBuf}, time::SystemTime
2+
path::{Path, PathBuf}, time::SystemTime
33
};
44

55
use std::collections::HashMap;
@@ -294,7 +294,6 @@ impl Model for InMemoryModel {
294294
}
295295
return Ok(true);
296296
}
297-
298297
}
299298

300299
// TODO: Implement a efficient sqlite Model with parellel processing support

0 commit comments

Comments
 (0)