Skip to content

Commit 80007fe

Browse files
committed
Create a new caching pipeline
Signed-off-by: Samet Akcay <[email protected]>
1 parent 1b62c34 commit 80007fe

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

.github/actions/pytest/action.yaml

+25-8
Original file line numberDiff line numberDiff line change
@@ -87,28 +87,45 @@ outputs:
8787
runs:
8888
using: composite
8989
steps:
90-
# Set up Python with pip caching
9190
- name: Set up Python environment
9291
uses: actions/setup-python@v5
9392
with:
9493
python-version: ${{ inputs.python-version }}
95-
cache: pip # Enable pip caching
96-
cache-dependency-path: pyproject.toml
9794

98-
# Create and configure virtual environment
95+
- name: Configure pip cache
96+
shell: bash
97+
run: |
98+
CACHE_DIR="/opt/github/cache/pip"
99+
100+
# Ensure cache directory exists and is writable
101+
sudo mkdir -p $CACHE_DIR
102+
sudo chmod 777 $CACHE_DIR
103+
104+
# Configure pip to use the persistent cache
105+
pip config set global.cache-dir $CACHE_DIR
106+
107+
# Display cache info
108+
echo "Using pip cache directory: $(pip cache dir)"
109+
echo "Current cache size: $(du -sh $CACHE_DIR 2>/dev/null || echo 'Empty')"
110+
99111
- name: Configure virtual environment
100112
id: setup-venv
101113
shell: bash
102114
run: |
103-
# Create isolated test environment
115+
# Create and activate venv
104116
python -m venv .venv
105117
source .venv/bin/activate
106-
# Install dependencies with dev extras
118+
119+
# Upgrade pip
107120
python -m pip install --upgrade pip
108-
pip install ".[dev]"
121+
122+
# Install dependencies using the persistent cache
123+
pip install --prefer-binary ".[dev]"
109124
pip install codecov
110125
111-
# Determine which tests to run based on input
126+
# Show installed packages for debugging
127+
pip list
128+
112129
- name: Determine test scope
113130
id: test-scope
114131
shell: bash

0 commit comments

Comments
 (0)