72 lines
1.6 KiB
YAML
72 lines
1.6 KiB
YAML
name: Integration Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- main
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
DATABASE_URL: postgres://postgres:postgres@localhost:5432/readur_test
|
|
|
|
jobs:
|
|
integration-tests:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: readur_test
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
tesseract-ocr \
|
|
tesseract-ocr-eng \
|
|
libtesseract-dev \
|
|
libleptonica-dev \
|
|
pkg-config \
|
|
libclang-dev \
|
|
clang
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
|
|
|
|
- name: Run integration tests
|
|
run: |
|
|
cargo test --test '*' -- --test-threads=1
|
|
env:
|
|
TEST_DATABASE_URL: ${{ env.DATABASE_URL }}
|
|
RUST_LOG: debug |