Skip to content

Benchmarking + Python Bug Fixes + Axum Bump #56

Benchmarking + Python Bug Fixes + Axum Bump

Benchmarking + Python Bug Fixes + Axum Bump #56

Workflow file for this run

name: Tests
on:
pull_request:
branches:
- main
jobs:
# =================================================
# Build & Image Upload
# =================================================
build:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
file: server/services/manager/Dockerfile
target: builder
outputs: type=docker,dest=/tmp/app-image.tar
tags: tacoq-manager:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Upload Docker image
uses: actions/upload-artifact@v4
with:
name: app-image
path: /tmp/app-image.tar
# =================================================
# Server Tests
# These only depend on the database, so we run the
# postgres service in the same container.
# =================================================
server-tests:
name: Run server tests
needs: [build]
runs-on: ubuntu-latest
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test_db
services:
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: test_db
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: app-image
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/app-image.tar
- name: Run tests in container
run: |
docker run --network host \
-e DATABASE_URL=${DATABASE_URL} \
tacoq-manager cargo test --release --all-features
# =================================================
# SDK Tests
# These also act as end-to-end tests for the server
# so we need to set up both Postgres AND the server
# in the same container.
# =================================================
python-sdk-tests:
name: Python SDK Tests
needs: [build]
runs-on: ubuntu-latest
environment:
name: github-pages
permissions:
contents: write # Only applies to this job
steps:
- uses: actions/checkout@v4
# Setup
- uses: ./.github/actions/setup_sdk_test_environment
with:
artifact-path: /tmp
# Python Tests
- name: Run Python tests
uses: ./.github/actions/test_python_sdk
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# Cleanup
- uses: ./.github/actions/cleanup_sdk_test_environment
if: always()