Skip to content

edge-orchestrator CI on branch >> 139/merge << #649

edge-orchestrator CI on branch >> 139/merge <<

edge-orchestrator CI on branch >> 139/merge << #649

name: CI edge-orchestrator
run-name: edge-orchestrator CI on branch >> ${{ github.ref_name }} <<
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
paths:
- "edge/orchestrator/**"
jobs:
lint_and_test_on_edge_orchestrator:
name: Run Python linter and tests (unit > integration > functional)
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
packages: read
strategy:
matrix:
python-version: ["3.11"]
services:
edge_tflite_serving:
image: ghcr.io/octo-technology/vio/edge_tflite_serving:main
ports:
- 8501:8501
options: --platform linux/amd64
env:
TFLITE_SERVING_HOST: localhost
TFLITE_SERVING_PORT: 8501
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Install dependencies
run: make install
working-directory: ./edge/orchestrator
- name: Lint with ruff
run: make check
working-directory: ./edge/orchestrator
- name: Run unit tests
run: make unit_tests
working-directory: ./edge/orchestrator
- name: Upload unit test report
uses: dorny/test-reporter@v1
if: ${{ always() }}
with:
name: Unit tests report in Python ${{ matrix.python-version }}
path: edge/orchestrator/reports/pytest/unit-tests-report.xml
reporter: java-junit
- name: Wait for edge_tflite_serving to be ready
run: |
for i in {1..30}; do
if curl -sf --max-time 2 http://localhost:8501/v1/; then
echo "Service is up!"
exit 0
fi
echo "Waiting... ($i/30)"
sleep 2
done
echo "=== Container status ==="
docker ps -a
echo "=== edge_tflite_serving logs ==="
docker logs $(docker ps -aq --filter "ancestor=ghcr.io/octo-technology/vio/edge_tflite_serving:main") 2>&1 || echo "Could not get container logs"
echo "Service did not start in time" >&2
exit 1
- name: Run integration tests
run: make integration_tests
working-directory: ./edge/orchestrator
- name: Upload integration test report
uses: dorny/test-reporter@v1
if: ${{ always() }}
with:
name: Integration tests report in Python ${{ matrix.python-version }}
path: edge/orchestrator/reports/pytest/integration-tests-report.xml
reporter: java-junit
- name: Run functional tests
run: make functional_tests
working-directory: ./edge/orchestrator
- name: Upload functional test report
uses: dorny/test-reporter@v1
if: ${{ always() }}
with:
name: Functional tests report in Python ${{ matrix.python-version }}
path: edge/orchestrator/reports/behave/*.xml
reporter: java-junit
build_and_push_images:
needs: lint_and_test_on_edge_orchestrator
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./edge/orchestrator/Dockerfile
image: ghcr.io/${{ github.repository }}/edge_orchestrator
context: ./edge/orchestrator
uses: ./.github/workflows/template_build_and_push_docker_images.yml
with:
context: ${{ matrix.context }}
dockerfile: ${{ matrix.dockerfile }}
image: ${{ matrix.image }}
secrets:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}