Skip to content

Commit

Permalink
Create a new caching pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
  • Loading branch information
samet-akcay committed Dec 12, 2024
1 parent 1b62c34 commit 80007fe
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions .github/actions/pytest/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,28 +87,45 @@ outputs:
runs:
using: composite
steps:
# Set up Python with pip caching
- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: pip # Enable pip caching
cache-dependency-path: pyproject.toml

# Create and configure virtual environment
- name: Configure pip cache
shell: bash
run: |
CACHE_DIR="/opt/github/cache/pip"
# Ensure cache directory exists and is writable
sudo mkdir -p $CACHE_DIR
sudo chmod 777 $CACHE_DIR
# Configure pip to use the persistent cache
pip config set global.cache-dir $CACHE_DIR
# Display cache info
echo "Using pip cache directory: $(pip cache dir)"
echo "Current cache size: $(du -sh $CACHE_DIR 2>/dev/null || echo 'Empty')"
- name: Configure virtual environment
id: setup-venv
shell: bash
run: |
# Create isolated test environment
# Create and activate venv
python -m venv .venv
source .venv/bin/activate
# Install dependencies with dev extras
# Upgrade pip
python -m pip install --upgrade pip
pip install ".[dev]"
# Install dependencies using the persistent cache
pip install --prefer-binary ".[dev]"
pip install codecov
# Determine which tests to run based on input
# Show installed packages for debugging
pip list
- name: Determine test scope
id: test-scope
shell: bash
Expand Down

0 comments on commit 80007fe

Please sign in to comment.