Skip to content

feat: implement cronjob service and scheduler #969

feat: implement cronjob service and scheduler

feat: implement cronjob service and scheduler #969

Workflow file for this run

name: Tests
on:
push:
branches: [ main, develop ]
pull_request:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: chat_api
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run unit tests
run: cargo test --lib --bins --features test
- name: Run integration tests
run: cargo test --features test
env:
DATABASE_HOST: localhost
DATABASE_PORT: 5432
DATABASE_NAME: chat_api
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_MAX_CONNECTIONS: 5
DATABASE_TLS_ENABLED: "false"
RUST_LOG: debug
DEV: "true"
STRIPE_SECRET_KEY: "sk_test_dummy_key_for_testing"
STRIPE_WEBHOOK_SECRET: "whsec_test_dummy_secret_for_testing"
AGENT_API_TOKEN: "test_token_for_ci"
- name: Build release
run: cargo build --release