edge_orchestrator CI on branch >> 55/merge << #338
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
strategy: | |
matrix: | |
python-version: [ "3.8", "3.9" ] # TODO: add 3.10 and 3.11 | |
services: | |
edge_db: | |
image: mongo:5.0.2 | |
ports: | |
- 27017:27017 | |
hub_monitoring_db: | |
image: postgres:15.1 | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_DB: test | |
POSTGRES_USER: test | |
POSTGRES_PASSWORD: test | |
edge_model_serving: | |
image: ghcr.io/octo-technology/vio/edge_model_serving:main | |
ports: | |
- 8501:8501 | |
edge_tflite_serving: | |
image: ghcr.io/octo-technology/vio/edge_tflite_serving:main | |
ports: | |
- 8502:8501 | |
env: | |
MONGO_DB_URI: mongodb://localhost:27017 | |
POSTGRES_DB_URI: postgresql://test:test@localhost:5432/test | |
TENSORFLOW_SERVING_HOST: localhost | |
TENSORFLOW_SERVING_PORT: 8501 | |
TFLITE_SERVING_HOST: localhost | |
TFLITE_SERVING_PORT: 8502 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: make install | |
working-directory: ./edge_orchestrator | |
- name: Lint with flake8 and black | |
run: make lint | |
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: 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 }} | |
build_and_push_arm_images: | |
needs: lint_and_test_on_edge_orchestrator | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- dockerfile: ./edge_orchestrator/Dockerfile.raspberrypi | |
image: ghcr.io/${{ github.repository }}/edge_orchestrator.raspberrypi | |
context: ./edge_orchestrator | |
uses: ./.github/workflows/template_build_and_push_docker_images.yml | |
with: | |
context: ${{ matrix.context }} | |
dockerfile: ${{ matrix.dockerfile }} | |
image: ${{ matrix.image }} | |
arm_build: true | |
secrets: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} |