89 lines
1.9 KiB
YAML
89 lines
1.9 KiB
YAML
name: Unit Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- main
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
rust-unit-tests:
|
|
name: Rust unit tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
tesseract-ocr \
|
|
tesseract-ocr-eng \
|
|
tesseract-ocr-spa \
|
|
tesseract-ocr-fra \
|
|
tesseract-ocr-deu \
|
|
tesseract-ocr-ita \
|
|
tesseract-ocr-por \
|
|
libtesseract-dev \
|
|
libleptonica-dev \
|
|
pkg-config \
|
|
libclang-dev \
|
|
ocrmypdf \
|
|
clang \
|
|
antiword \
|
|
catdoc
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
|
|
- name: Run Rust unit tests - lib only
|
|
run: |
|
|
cargo test --lib --no-fail-fast
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
|
|
- name: Run Rust unit tests - unit_tests only
|
|
run: |
|
|
cargo test --tests unit_tests --no-fail-fast
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
|
|
frontend-unit-tests:
|
|
name: Frontend unit tests
|
|
runs-on: ubuntu-latest
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: ./frontend
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "22"
|
|
cache: "npm"
|
|
cache-dependency-path: frontend/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Run type checking
|
|
run: npm run type-check
|
|
|
|
- name: Run frontend unit tests
|
|
run: npm run test:unit
|