Skip to content

Ahnlich python client #95

Ahnlich python client

Ahnlich python client #95

Workflow file for this run

name: Rust Test
on:
push:
branches: ["main"]
paths:
- ahnlich/**
- sdk/**
pull_request:
branches: ["main"]
paths:
- ahnlich/**
- sdk/**
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: ahnlich
- name: Set up cargo and rustup tools
run: |
which cargo-nextest || cargo install cargo-nextest
- name: Cache Docker images.
uses: ScribeMD/docker-cache@0.5.0
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('ahnlich/Cargo.lock') }}
- name: Format and Lint
working-directory: ./ahnlich
run: |
make format
make clippy
- name: Run Test
working-directory: ./ahnlich
run: |
make test
run-python-tests:
if: ${{ always() && needs.build.result == 'success' }}
runs-on: ubuntu-latest
needs: ["build"]
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.0
- name: View poetry --help
run: poetry --help
- name: Cache using poetry lock
uses: actions/cache@v3
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Testing dir
run: |
ls && pwd
- name: Installing poetry dependencies
working-directory: ./sdk/ahnlich-client-py
run: poetry install
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: ahnlich
- name: Run Rust DB Server
working-directory: ./ahnlich
run: |
cargo run --bin ahnlich-db run --port 1349 &
- name: Run Python Client Tests
working-directory: ./sdk/ahnlich-client-py
env:
AHNLICH_DB_HOST: "127.0.0.1"
AHNLICH_DB_PORT: 1349
run: |
poetry run pytest