feat: add verbose parameter to fit_selective and update notebook with… #104
This file contains hidden or 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 for SKFeatureLLM | |
| on: | |
| push: | |
| branches: | |
| - '**' # Run pre-commit on all branches | |
| tags: | |
| - 'v*' # Also trigger when a version tag (e.g., v1.0.0) is pushed | |
| pull_request: | |
| branches: | |
| - '**' # Run pre-commit and tests on PRs | |
| jobs: | |
| pre-commit: | |
| name: Run Pre-Commit Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Cache Poetry dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pypoetry | |
| key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-poetry- | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| version: 1.5.1 | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| - name: Install dependencies | |
| run: | | |
| poetry install --with dev | |
| poetry run pre-commit install | |
| - name: Run pre-commit checks | |
| run: | | |
| poetry run pre-commit run --all-files --show-diff-on-failure | |
| run-tests: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Cache Poetry dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pypoetry | |
| key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-poetry- | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| version: 1.5.1 | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| - name: Install dependencies | |
| run: | | |
| poetry install --with dev | |
| - name: Run tests | |
| run: | | |
| poetry run pytest --cov=skfeaturellm --cov-report=term-missing --cov-report=xml --cov-fail-under=90 | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| create-tag: | |
| name: Create Version Tag | |
| needs: [pre-commit, run-tests] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: write # Required for pushing tags | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required to get git history for version detection | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Get latest version | |
| id: get_version | |
| run: | | |
| # Get the latest version tag | |
| latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") | |
| # Remove the 'v' prefix | |
| latest_version=${latest_tag#v} | |
| # Split into major.minor.patch | |
| IFS='.' read -r major minor patch <<< "$latest_version" | |
| # Increment patch version | |
| new_patch=$((patch + 1)) | |
| new_version="${major}.${minor}.${new_patch}" | |
| echo "new_version=${new_version}" >> $GITHUB_OUTPUT | |
| - name: Create and push version tag | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git tag -a "v${{ steps.get_version.outputs.new_version }}" -m "Version ${{ steps.get_version.outputs.new_version }}" | |
| git push origin "v${{ steps.get_version.outputs.new_version }}" | |
| publish: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| needs: create-tag | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/skfeaturellm | |
| permissions: | |
| id-token: write # Required for Trusted Publishing | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required to get git history for version detection | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| version: 1.5.1 | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| - name: Update version in pyproject.toml | |
| run: | | |
| latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") | |
| # Remove the 'v' prefix | |
| latest_version=${latest_tag#v} | |
| poetry version $latest_version | |
| - name: Build package | |
| run: | | |
| poetry build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |