Alpha to master v 0.9.0.3 #203
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/CD Workflow for mloptimizer | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.9, '3.10', 3.11] | |
os: [ubuntu-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Set up Python 3.x environment | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Install pytest and pytest-cov | |
run: pip install pytest pytest-cov pytest-mock | |
- name: Install mlflow | |
run: pip install mlflow | |
- name: Set PYTHONPATH | |
run: echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV # Set PYTHONPATH to the root of the project | |
- name: List directory structure | |
run: | | |
echo "Listing project directory:" | |
ls -R # Recursively list the directory contents to help diagnose the structure | |
- name: Print Python version and Path | |
run: | | |
echo "Python version:" | |
python --version | |
echo "Python Path:" | |
python -c "import sys; print(sys.path)" # Print Python's path to see if mloptimizer is included | |
- name: Run tests and collect coverage | |
run: | | |
echo "Running tests..." | |
pytest --cov=mloptimizer -v # Use verbose mode for more output | |
- name: Upload coverage to Codecov | |
if: github.ref_name == 'dev' || github.ref_name == 'alpha' || github.ref_name == 'master' | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |