Skip to content

job streaming support #2080

job streaming support

job streaming support #2080

name: Run integration tests
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
env:
PYTHON_DEFAULT_VERSION: "3.11"
jobs:
test:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
cache: "pip"
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.5.3"
enable-cache: true
- name: Install dependencies
run: python -m pip install --upgrade nox
- name: Setup common virtualenv
# In order not to exhaust disk on GitHub runner, we use one single
# virtualenv for all pdm projects: miner, executor, validator.
run: |
python -m venv .venv
echo "$.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=${{ github.workspace }}/.venv" >> $GITHUB_ENV
- name: Install test dependencies
run: uv sync --locked
- name: Prepare miner environment
run: ./setup-dev.sh
working-directory: ./miner
- name: Prepare executor environment
run: ./setup-dev.sh
working-directory: ./executor
- name: Prepare validator environment
run: ./setup-dev.sh
working-directory: ./validator
- name: Run miner dockerized services
run: docker compose up -d --wait
working-directory: ./miner
- name: Run validator dockerized services
run: docker compose up -d --wait
working-directory: ./validator
- name: Run miner migrations
run: cd app/src && uv run --no-sync python manage.py wait_for_database --timeout 120 && uv run --no-sync python manage.py migrate
working-directory: ./miner
- name: Run validator migrations
run: cd app/src && uv run --no-sync python manage.py wait_for_database --timeout 120 && uv run --no-sync python manage.py migrate
working-directory: ./validator
- name: Build backenddevelopersltd/compute-horde-job-echo:v0-latest image
run: docker build . -t backenddevelopersltd/compute-horde-job-echo:v0-latest
working-directory: ./executor/app/src/compute_horde_executor/executor/tests/integration/docker_image_for_tests/
- name: Run unit tests
run: nox -vs test
- name: Stop miner dockerized services
if: success() || failure()
run: docker compose down -v
working-directory: ./miner
- name: Stop validator dockerized services
if: success() || failure()
run: docker compose down -v
working-directory: ./validator