Skip to content

Ml loops

Ml loops #38

Workflow file for this run

name: (With Mongo) Tests on py11
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
env:
MONGO_ENABLED: true
LMDB_ENABLED: false
if: "!contains(github.event.head_commit.message, 'CI Bot')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Show OS Info
run: '[[ "$OSTYPE" == "linux-gnu"* ]] && { echo "OS Type: Linux"; (command -v lsb_release &> /dev/null && lsb_release -a) || cat /etc/os-release; uname -r; } || [[ "$OSTYPE" == "darwin"* ]] && { echo "OS Type: macOS"; sw_vers; uname -r; } || echo "Unsupported OS type: $OSTYPE"'
- name: Start docker compose with redis
run: make services-mongo
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Show Python version
run: python --version && pip --version
- name: Test examples
run: bash .github/workflows/run_examples.sh examples true # with mongo
- name: Install all dependencies
run: |
python -m pip install .[all]
python -m pip install .[ml_dev]
- name: List installed packages
run: pip list
- name: Test with pytest and redis
run: |
make tests
- name: Test notebooks with pytest and redis
run: make tests-notebooks
- name: Stop services
run: make services-stop-mongo
- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \; || true
- name: Start docker compose with kafka
run: docker compose -f deployment/compose-kafka.yml up -d
- name: Wait for one minute
run: sleep 60
- name: Check liveness
run: |
export MQ_TYPE=kafka
export MQ_PORT=9092
python -c 'from flowcept.configs import MQ_TYPE, MQ_PORT; print(f"MQ_TYPE={MQ_TYPE}"); print(f"MQ_PORT={MQ_PORT}")'
python -c 'from flowcept import Flowcept; assert Flowcept.services_alive()'
- name: Run tests with kafka
run: |
export MQ_TYPE=kafka
export MQ_PORT=9092
# Ignoring heavy tests. They are executed with Kafka in another GH Action.
pytest
- name: Stop services
run: docker compose -f deployment/compose-kafka.yml down
- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \; || true
docker image prune -a -f