Skip to content

Moved VERSION file inside the package to be store with the installation #9

Moved VERSION file inside the package to be store with the installation

Moved VERSION file inside the package to be store with the installation #9

name: Build and Install Test for mloptimizer
on:
push:
branches:
- alpha
pull_request:
branches:
- alpha
jobs:
build-install-test:
runs-on: ubuntu-latest
steps:
# Checkout the repository code
- name: Checkout code
uses: actions/checkout@v4
# Set up Python environment (choose Python version as needed)
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
# Install build tool and create the package
- name: Install build tool and build package
run: |
python -m pip install --upgrade pip
python -m pip install build
python -m build --sdist --wheel --outdir dist/
# Set up virtual environment and install the built package
- name: Test package installation in a clean environment
run: |
python -m venv venv
source venv/bin/activate
pip install dist/*.whl # Install the wheel package created
# Confirm installation
pip show mloptimizer
python -m pip install pytest pytest-mock pytest-cov
python -m pip install mlflow
pytest --pyargs mloptimizer # Run tests directly from installed package