Merge dev to main: Security improvements and comprehensive test infrastructure #39
+14
-10
@@ -28,9 +28,10 @@ jobs:
|
||||
- name: Cache Python dependencies
|
||||
id: cache-python
|
||||
run: |
|
||||
CACHE_KEY="python-$(md5sum dashboard/backend/requirements.txt dashboard/backend/requirements-dev.txt | md5sum | cut -d' ' -f1)"
|
||||
CACHE_KEY="python-$(cat dashboard/backend/requirements.txt dashboard/backend/requirements-dev.txt | md5sum | cut -d' ' -f1)"
|
||||
CACHE_DIR="/tmp/pytest-cache/$CACHE_KEY"
|
||||
echo "CACHE_DIR=$CACHE_DIR" >> $GITHUB_ENV
|
||||
echo "CACHE_KEY=$CACHE_KEY" >> $GITHUB_ENV
|
||||
if [ -d "$CACHE_DIR" ]; then
|
||||
echo "Cache hit for $CACHE_KEY"
|
||||
echo "cache-hit=true" >> $GITHUB_OUTPUT
|
||||
@@ -44,17 +45,18 @@ jobs:
|
||||
run: |
|
||||
cd dashboard/backend
|
||||
if [ "${{ steps.cache-python.outputs.cache-hit }}" = "true" ]; then
|
||||
echo "Restoring from cache..."
|
||||
cp -r $CACHE_DIR/venv .
|
||||
echo "Restoring from cache $CACHE_KEY..."
|
||||
cp -a $CACHE_DIR/venv .
|
||||
else
|
||||
echo "Installing fresh dependencies..."
|
||||
python3 -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements-dev.txt
|
||||
pip install pytest-timeout
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
pip install --no-cache-dir -r requirements-dev.txt
|
||||
pip install --no-cache-dir pytest-timeout
|
||||
# Save to cache
|
||||
cp -r venv $CACHE_DIR/
|
||||
echo "Saving to cache $CACHE_KEY..."
|
||||
cp -a venv $CACHE_DIR/
|
||||
fi
|
||||
|
||||
- name: Run unit tests
|
||||
@@ -91,6 +93,7 @@ jobs:
|
||||
CACHE_KEY="node-$(md5sum dashboard/frontend/package-lock.json | cut -d' ' -f1)"
|
||||
CACHE_DIR="/tmp/npm-cache/$CACHE_KEY"
|
||||
echo "CACHE_DIR=$CACHE_DIR" >> $GITHUB_ENV
|
||||
echo "CACHE_KEY=$CACHE_KEY" >> $GITHUB_ENV
|
||||
if [ -d "$CACHE_DIR" ]; then
|
||||
echo "Cache hit for $CACHE_KEY"
|
||||
echo "cache-hit=true" >> $GITHUB_OUTPUT
|
||||
@@ -106,13 +109,14 @@ jobs:
|
||||
run: |
|
||||
cd dashboard/frontend
|
||||
if [ "${{ steps.cache-node.outputs.cache-hit }}" = "true" ]; then
|
||||
echo "Restoring from cache..."
|
||||
cp -r $CACHE_DIR/node_modules .
|
||||
echo "Restoring from cache $CACHE_KEY..."
|
||||
cp -a $CACHE_DIR/node_modules .
|
||||
else
|
||||
echo "Installing fresh dependencies..."
|
||||
npm ci
|
||||
# Save to cache
|
||||
cp -r node_modules $CACHE_DIR/
|
||||
echo "Saving to cache $CACHE_KEY..."
|
||||
cp -a node_modules $CACHE_DIR/
|
||||
fi
|
||||
|
||||
- name: Run tests
|
||||
|
||||
Reference in New Issue
Block a user