Skip to content

[Feature] Fallbacks for requests and events handling #71

[Feature] Fallbacks for requests and events handling

[Feature] Fallbacks for requests and events handling #71

Workflow file for this run

name: CodSpeed
on:
push:
branches:
- "main"
- "master"
pull_request:
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Start infrastructure
run: |
docker compose -f docker-compose-test.yml up -d
- name: Wait for MySQL
run: |
for i in $(seq 1 30); do
if docker compose -f docker-compose-test.yml exec -T mysql_tests mysqladmin ping -h localhost -ucqrs -pcqrs --silent 2>/dev/null; then
echo "MySQL is ready"
exit 0
fi
echo "Waiting for MySQL... ($i/30)"
sleep 2
done
echo "MySQL did not become ready in time"
exit 1
- name: Wait for PostgreSQL
run: |
for i in $(seq 1 30); do
if docker compose -f docker-compose-test.yml exec -T postgres_tests pg_isready -h localhost -U cqrs -q 2>/dev/null; then
echo "PostgreSQL is ready"
exit 0
fi
echo "Waiting for PostgreSQL... ($i/30)"
sleep 2
done
echo "PostgreSQL did not become ready in time"
exit 1
- name: Wait for Redis
run: |
for i in $(seq 1 15); do
if docker compose -f docker-compose-test.yml exec -T redis_tests redis-cli ping 2>/dev/null | grep -q PONG; then
echo "Redis is ready"
exit 0
fi
echo "Waiting for Redis... ($i/15)"
sleep 1
done
echo "Redis did not become ready in time"
exit 1
- name: Run benchmarks
uses: CodSpeedHQ/action@v4
with:
mode: simulation
run: pytest -c ./tests/pytest-config.ini tests/benchmarks/ --codspeed
- name: Stop infrastructure
if: always()
run: docker compose -f docker-compose-test.yml down -v