Skip to content

Abhisheku/mmlab model selection #1022

Abhisheku/mmlab model selection

Abhisheku/mmlab model selection #1022

name: training-model-mgmt-unittests
on:
pull_request:
branches:
- main
paths:
- assets/training/model_management/**
- assets/common/components/register_model/**
- assets/common/src/model_registration/**
- assets/common/components/mlflow_model_local_validation/**
- assets/common/src/mlflow_model_local_validation/**
- .github/workflows/training-model-mgmt-unittests.yaml
workflow_dispatch:
env:
conda_env_prefix: /opt/conda/envs/model_mgmt
model_mgmt_root_dir: assets/training/model_management
model_mgmt_src_dir: assets/training/model_management/src/azureml/
model_mgmt_test_dir: assets/training/model_management/tests
model_mgmt_unittests_dir: assets/training/model_management/tests/unittests
model_mgmt_test_req: assets/training/model_management/tests/dev_requirements.txt
model_mgmt_conda_yaml: assets/training/model_management/tests/dev_conda_env.yaml
pytest_reports: pytest-reports
jobs:
run_unit_tests:
name: Run
runs-on: ubuntu-latest
permissions:
# Required for EnricoMi/publish-unit-test-result-action
checks: write
issues: read
pull-requests: write
steps:
- name: Clone branch
uses: actions/checkout@v3
- name: Use Python 3.10 or newer
uses: actions/setup-python@v4
with:
python-version: '>=3.10'
- name: Create conda env
run: |
set -ex
apt-get update && apt-get upgrade && apt-get install -y build-essential
echo $conda_env_prefix
conda env create -p $conda_env_prefix -f $model_mgmt_conda_yaml -q
echo "conda env successfully created at $conda_env_prefix"
conda list -p $conda_env_prefix
- name: Copy dir
run: |
cp -r $model_mgmt_src_dir $model_mgmt_unittests_dir
ls -l $model_mgmt_unittests_dir
- name: Execute tests
run: conda run -p $conda_env_prefix python -m pytest $model_mgmt_unittests_dir --tb=native --junitxml=$pytest_reports/test-result.xml -x -n 1 -ra --show-capture=no
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: Test Results for ${{ github.workflow }}
junit_files: ${{ env.pytest_reports }}/**/*.xml