Skip to content

Commit

Permalink
removing virtual env from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BenJourdan committed Oct 12, 2024
1 parent 397b4f3 commit 8b74af3
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,46 +36,35 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
# Step 4: Set up and activate virtual environment
- name: Set up and activate virtual environment
id: activate-venv
run: |
python -m venv venv
source venv/bin/activate || .\venv\Scripts\activate
shell: bash

# Step 5: Install dependencies (including maturin and project dependencies)
# Step 4: Install dependencies (including maturin and project dependencies)
- name: Install dependencies
run: |
pip install --upgrade pip
pip install maturin
pip install -r requirements.txt
shell: bash

# Step 6: Run Ruff linter and fail on any issues
# Step 5: Run Ruff linter and fail on any issues
- name: Run Ruff (Python linter)
run: |
ruff check .
shell: bash

# Step 7: Run Black formatter
# Step 6: Run Black formatter
- name: Run Black (Python formatter)
run: |
black --check .
shell: bash

# Step 8: Build and install the Rust library using Maturin (in release mode)
# Step 7: Build and install the Rust library using Maturin (in release mode)
- name: Build and install Rust library (release mode)
run: |
source venv/bin/activate || .\venv\Scripts\activate
./venv/bin/python -m maturin develop --release
python -c "import coreset_sc; print(coreset_sc.__file__)"
maturin develop --release # Build the Rust library and install it globally
shell: bash

# Step 9: Run Python tests with pytest
# Step 8: Run Python tests with pytest
- name: Run Python tests with pytest
run: |
source venv/bin/activate || .\venv\Scripts\activate
pytest tests/ # Run tests
shell: bash

Expand All @@ -94,29 +83,21 @@ jobs:
with:
python-version: '3.10' # Just need a single Python version to build docs

# Step 3: Set up and activate virtual environment for Sphinx
- name: Set up and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate || .\venv\Scripts\activate
shell: bash

# Step 4: Install dependencies for docs
# Step 3: Install dependencies for docs
- name: Install dependencies for docs
run: |
pip install --upgrade pip
pip install -r requirements.txt
shell: bash

# Step 5: Build Sphinx documentation
# Step 4: Build Sphinx documentation
- name: Build Sphinx documentation
run: |
source venv/bin/activate || .\venv\Scripts\activate # Activate virtual environment
cd docs
make html
shell: bash

# Step 6: Deploy to GitHub Pages
# Step 5: Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down

0 comments on commit 8b74af3

Please sign in to comment.