Cleaning up the CI workflow.
Some checks are pending
Tests / Frontend Tests (TypeScript + Vue + Yarn Berry) (push) Has been skipped
Tests / Backend Setup (Python 3.13 + uv + Environment) (push) Has been skipped
Tests / Frontend Setup (Node.js 24 + Yarn Berry + Build) (push) Has been skipped
Tests / Backend Tests (Python 3.13 + uv) (push) Has been skipped
Tests / Setup and Checkout (push) Waiting to run
Some checks are pending
Tests / Frontend Tests (TypeScript + Vue + Yarn Berry) (push) Has been skipped
Tests / Backend Setup (Python 3.13 + uv + Environment) (push) Has been skipped
Tests / Frontend Setup (Node.js 24 + Yarn Berry + Build) (push) Has been skipped
Tests / Backend Tests (Python 3.13 + uv) (push) Has been skipped
Tests / Setup and Checkout (push) Waiting to run
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
@@ -14,100 +14,33 @@ jobs:
|
||||
steps:
|
||||
- name: Runner Info
|
||||
run: |
|
||||
echo "==================== SETUP JOB RUNNER INFO ===================="
|
||||
echo "Job: setup"
|
||||
echo "Runner OS: $(uname -a)"
|
||||
echo "Hostname: $(hostname)"
|
||||
echo "Runner User: $(whoami)"
|
||||
echo "Runner Name: ${{ gitea.runner_name }}"
|
||||
echo "Runner Home: $HOME"
|
||||
echo "Working Directory: $(pwd)"
|
||||
echo "Runner IP: $(hostname -I 2>/dev/null || echo 'IP not available')"
|
||||
echo "Container ID: $(cat /proc/self/cgroup 2>/dev/null | head -1 | cut -d'/' -f3 || echo 'Not in container')"
|
||||
echo "Available CPU cores: $(nproc)"
|
||||
echo "Available Memory: $(free -h | grep '^Mem:' | awk '{print $2}' || echo 'Memory info not available')"
|
||||
echo "Disk space: $(df -h . | tail -1 | awk '{print $4}' || echo 'Disk info not available')"
|
||||
echo "Runner started at: $(date)"
|
||||
echo "=============================================================="
|
||||
|
||||
- name: Debug SSH Setup
|
||||
run: |
|
||||
echo "=== SSH Debug Information ==="
|
||||
echo "Current directory is: $(pwd)"
|
||||
echo "Home directory is: $HOME"
|
||||
|
||||
echo "SSH client version:"
|
||||
ssh -V 2>&1 || echo "SSH not available"
|
||||
|
||||
echo "SSH directory contents:"
|
||||
ls -la ~/.ssh/ 2>/dev/null || echo "No ~/.ssh directory"
|
||||
|
||||
echo "Checking for SSH keys in common locations:"
|
||||
find /data/.ssh -name "id_*" -type f 2>/dev/null || echo "No SSH keys found in /data"
|
||||
|
||||
echo "SSH agent status:"
|
||||
ssh-add -l 2>/dev/null || echo "SSH agent not running or no keys loaded"
|
||||
|
||||
echo "Environment variables:"
|
||||
env | grep -E "(SSH|GIT)" || echo "No SSH/GIT environment variables"
|
||||
|
||||
echo "Runner filesystem info:"
|
||||
whoami
|
||||
pwd
|
||||
echo "HOME: $HOME"
|
||||
|
||||
echo "Docker environment check:"
|
||||
cat /proc/1/cgroup 2>/dev/null | head -3 || echo "Not in container or no cgroup info"
|
||||
echo "=== Setup Job - $(date) ==="
|
||||
echo "Runner: ${RUNNER_NAME:-$(hostname)} | User: $(whoami) | OS: $(uname -s)"
|
||||
echo "Resources: $(nproc) cores, $(free -h | awk '/^Mem:/ {print $2}') RAM"
|
||||
|
||||
- name: Checkout code
|
||||
run: |
|
||||
echo "=== Repository Checkout ==="
|
||||
echo "Repository: ${{ github.repository }}"
|
||||
echo "Ref: ${{ github.ref }}"
|
||||
echo "SHA: ${{ github.sha }}"
|
||||
echo "Workspace: ${{ github.workspace }}"
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Fallback checkout (if needed)
|
||||
if: failure()
|
||||
run: |
|
||||
echo "=== Fallback Repository Checkout ==="
|
||||
cd ${{ github.workspace }}
|
||||
|
||||
# Try HTTP first (most reliable for current setup)
|
||||
echo "Attempting repository clone..."
|
||||
|
||||
# Try internal network HTTP first
|
||||
# Try HTTP clone as fallback
|
||||
if git clone --depth 1 http://gitea:3000/DarkHelm.org/plex-playlist.git . 2>/dev/null; then
|
||||
echo "✓ Internal HTTP clone successful"
|
||||
# Try external HTTP
|
||||
elif git clone --depth 1 http://dogar.darkhelm.org/DarkHelm.org/plex-playlist.git . 2>/dev/null; then
|
||||
echo "✓ External HTTP clone successful"
|
||||
else
|
||||
echo "HTTP failed, trying SSH..."
|
||||
mkdir -p ~/.ssh
|
||||
|
||||
# Add known hosts
|
||||
echo "Adding SSH known hosts..."
|
||||
ssh-keyscan -p 22 -H gitea >> ~/.ssh/known_hosts 2>/dev/null || echo "Internal SSH keyscan completed"
|
||||
ssh-keyscan -p 2222 -H dogar.darkhelm.org >> ~/.ssh/known_hosts 2>/dev/null || echo "External SSH keyscan completed"
|
||||
|
||||
# Try SSH (internal first, then external)
|
||||
if ssh -T git@gitea 2>&1 | grep -q "successfully authenticated\|Hi.*You've successfully authenticated"; then
|
||||
echo "✓ Internal SSH authentication successful"
|
||||
git clone --depth 1 git@gitea:DarkHelm.org/plex-playlist.git .
|
||||
elif ssh -T -p 2222 git@dogar.darkhelm.org 2>&1 | grep -q "successfully authenticated\|Hi.*You've successfully authenticated"; then
|
||||
echo "✓ External SSH authentication successful"
|
||||
git clone --depth 1 ssh://git@dogar.darkhelm.org:2222/DarkHelm.org/plex-playlist.git .
|
||||
else
|
||||
echo "❌ All clone methods failed"
|
||||
echo "SSH debug info:"
|
||||
ls -la ~/.ssh/ || echo "No ~/.ssh directory"
|
||||
ssh-add -l 2>/dev/null || echo "No SSH keys loaded"
|
||||
exit 1
|
||||
fi
|
||||
echo "❌ All clone methods failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git checkout ${{ github.sha }} 2>/dev/null || echo "Using HEAD commit"
|
||||
|
||||
echo "Repository contents:"
|
||||
ls -la
|
||||
|
||||
- name: Upload source code
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -125,20 +58,8 @@ jobs:
|
||||
steps:
|
||||
- name: Runner Info
|
||||
run: |
|
||||
echo "==================== BACKEND SETUP JOB RUNNER INFO ===================="
|
||||
echo "Job: backend-setup"
|
||||
echo "Runner OS: $(uname -a)"
|
||||
echo "Hostname: $(hostname)"
|
||||
echo "Runner User: $(whoami)"
|
||||
echo "Runner Home: $HOME"
|
||||
echo "Working Directory: $(pwd)"
|
||||
echo "Runner IP: $(hostname -I 2>/dev/null || echo 'IP not available')"
|
||||
echo "Container ID: $(cat /proc/self/cgroup 2>/dev/null | head -1 | cut -d'/' -f3 || echo 'Not in container')"
|
||||
echo "Available CPU cores: $(nproc)"
|
||||
echo "Available Memory: $(free -h | grep '^Mem:' | awk '{print $2}' || echo 'Memory info not available')"
|
||||
echo "Disk space: $(df -h . | tail -1 | awk '{print $4}' || echo 'Disk info not available')"
|
||||
echo "Runner started at: $(date)"
|
||||
echo "========================================================================"
|
||||
echo "=== Backend Setup - $(date) ==="
|
||||
echo "Runner: ${RUNNER_NAME:-$(hostname)} | User: $(whoami) | OS: $(uname -s)"
|
||||
|
||||
- name: Download source code
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -149,11 +70,10 @@ jobs:
|
||||
- name: Install Python 3.13
|
||||
run: |
|
||||
echo "=== Installing Python 3.13 ==="
|
||||
# Add deadsnakes PPA for Python 3.13
|
||||
sudo apt-get update
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y software-properties-common
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa -y
|
||||
sudo apt-get update
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y python3.13 python3.13-venv python3.13-dev curl git
|
||||
|
||||
- name: Install uv
|
||||
@@ -174,36 +94,19 @@ jobs:
|
||||
working-directory: ./backend
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
echo "=== Setting up Python environment with uv ==="
|
||||
echo "=== Setting up Python environment ==="
|
||||
|
||||
# Check if we have a proper pyproject.toml
|
||||
if [ -f pyproject.toml ]; then
|
||||
echo "Found pyproject.toml, validating structure..."
|
||||
cat pyproject.toml
|
||||
echo "---"
|
||||
else
|
||||
echo "No pyproject.toml found, this should not happen"
|
||||
exit 1
|
||||
fi
|
||||
# Validate pyproject.toml exists
|
||||
[ -f pyproject.toml ] || { echo "❌ pyproject.toml not found"; exit 1; }
|
||||
|
||||
# Create virtual environment
|
||||
echo "Creating virtual environment..."
|
||||
# Create virtual environment and install dependencies
|
||||
uv venv .venv --python python3.13
|
||||
|
||||
# Activate environment and install dev dependencies
|
||||
echo "Installing project with dev dependencies..."
|
||||
. .venv/bin/activate
|
||||
uv pip install -e ".[dev]"
|
||||
|
||||
# Verify installation
|
||||
echo "Verifying Python environment..."
|
||||
python --version
|
||||
python -c "import backend; print(f'Backend version: {backend.__version__}')"
|
||||
|
||||
# Show installed packages
|
||||
echo "Installed packages:"
|
||||
uv pip list
|
||||
|
||||
echo "✓ Backend environment setup complete"
|
||||
|
||||
- name: Upload backend environment
|
||||
@@ -223,20 +126,8 @@ jobs:
|
||||
steps:
|
||||
- name: Runner Info
|
||||
run: |
|
||||
echo "==================== FRONTEND SETUP JOB RUNNER INFO ===================="
|
||||
echo "Job: frontend-setup"
|
||||
echo "Runner OS: $(uname -a)"
|
||||
echo "Hostname: $(hostname)"
|
||||
echo "Runner User: $(whoami)"
|
||||
echo "Runner Home: $HOME"
|
||||
echo "Working Directory: $(pwd)"
|
||||
echo "Runner IP: $(hostname -I 2>/dev/null || echo 'IP not available')"
|
||||
echo "Container ID: $(cat /proc/self/cgroup 2>/dev/null | head -1 | cut -d'/' -f3 || echo 'Not in container')"
|
||||
echo "Available CPU cores: $(nproc)"
|
||||
echo "Available Memory: $(free -h | grep '^Mem:' | awk '{print $2}' || echo 'Memory info not available')"
|
||||
echo "Disk space: $(df -h . | tail -1 | awk '{print $4}' || echo 'Disk info not available')"
|
||||
echo "Runner started at: $(date)"
|
||||
echo "========================================================================"
|
||||
echo "=== Frontend Setup - $(date) ==="
|
||||
echo "Runner: ${RUNNER_NAME:-$(hostname)} | User: $(whoami) | OS: $(uname -s)"
|
||||
|
||||
- name: Download source code
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -269,68 +160,38 @@ jobs:
|
||||
run: |
|
||||
echo "=== Frontend Dependency Installation ==="
|
||||
|
||||
# Initialize yarn berry and allow lockfile creation
|
||||
# Setup Yarn Berry with lockfile creation allowed
|
||||
yarn set version stable
|
||||
cat > .yarnrc.yml << EOF
|
||||
enableImmutableInstalls: false
|
||||
nodeLinker: pnp
|
||||
compressionLevel: 0
|
||||
httpTimeout: 60000
|
||||
EOF
|
||||
|
||||
# Configure yarn for faster, more reliable installation
|
||||
echo "enableImmutableInstalls: false" > .yarnrc.yml
|
||||
echo "nodeLinker: pnp" >> .yarnrc.yml
|
||||
echo "compressionLevel: 0" >> .yarnrc.yml
|
||||
echo "httpTimeout: 60000" >> .yarnrc.yml
|
||||
|
||||
# Add packageManager field to package.json to avoid warnings
|
||||
# Add packageManager field if missing
|
||||
if ! grep -q '"packageManager"' package.json; then
|
||||
# Add packageManager field before the closing brace
|
||||
sed -i '$ s/}/ "packageManager": "yarn@4.10.3",\n}/' package.json
|
||||
fi
|
||||
|
||||
# Install dependencies
|
||||
echo "Installing dependencies with Yarn Berry..."
|
||||
yarn install
|
||||
echo "✓ Frontend dependencies installed"
|
||||
|
||||
echo "✓ Frontend dependencies installed successfully"
|
||||
|
||||
- name: Verify TypeScript and Vue
|
||||
- name: Verify and build frontend
|
||||
working-directory: ./frontend
|
||||
run: |
|
||||
echo "=== Verifying TypeScript and Vue Setup ==="
|
||||
echo "=== TypeScript Check & Build ==="
|
||||
|
||||
# Check TypeScript compilation
|
||||
echo "Checking TypeScript compilation..."
|
||||
yarn run tsc --noEmit || echo "TypeScript check completed with warnings"
|
||||
|
||||
# Verify Vue and TypeScript integration
|
||||
echo "Verifying Vue and TypeScript integration..."
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
||||
console.log('Vue version:', pkg.dependencies?.vue || 'Not found');
|
||||
console.log('TypeScript version:', pkg.devDependencies?.typescript || 'Not found');
|
||||
console.log('Vite version:', pkg.devDependencies?.vite || 'Not found');
|
||||
"
|
||||
|
||||
echo "✓ TypeScript and Vue verification complete"
|
||||
|
||||
- name: Build frontend
|
||||
working-directory: ./frontend
|
||||
run: |
|
||||
echo "=== Building Frontend ==="
|
||||
|
||||
# Build the frontend application
|
||||
# Build the frontend
|
||||
yarn run build
|
||||
|
||||
# Verify build output
|
||||
if [ -d "dist" ]; then
|
||||
echo "Build successful! Contents of dist/:"
|
||||
ls -la dist/
|
||||
echo "Build size:"
|
||||
du -sh dist/
|
||||
else
|
||||
echo "Build failed - no dist directory found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✓ Frontend build complete"
|
||||
[ -d "dist" ] || { echo "❌ Build failed - no dist directory"; exit 1; }
|
||||
echo "✓ Build successful ($(du -sh dist/ | cut -f1))"
|
||||
|
||||
- name: Upload frontend environment
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -349,20 +210,8 @@ jobs:
|
||||
steps:
|
||||
- name: Runner Info
|
||||
run: |
|
||||
echo "==================== BACKEND TESTS JOB RUNNER INFO ===================="
|
||||
echo "Job: backend-tests"
|
||||
echo "Runner OS: $(uname -a)"
|
||||
echo "Hostname: $(hostname)"
|
||||
echo "Runner User: $(whoami)"
|
||||
echo "Runner Home: $HOME"
|
||||
echo "Working Directory: $(pwd)"
|
||||
echo "Runner IP: $(hostname -I 2>/dev/null || echo 'IP not available')"
|
||||
echo "Container ID: $(cat /proc/self/cgroup 2>/dev/null | head -1 | cut -d'/' -f3 || echo 'Not in container')"
|
||||
echo "Available CPU cores: $(nproc)"
|
||||
echo "Available Memory: $(free -h | grep '^Mem:' | awk '{print $2}' || echo 'Memory info not available')"
|
||||
echo "Disk space: $(df -h . | tail -1 | awk '{print $4}' || echo 'Disk info not available')"
|
||||
echo "Runner started at: $(date)"
|
||||
echo "========================================================================"
|
||||
echo "=== Backend Tests - $(date) ==="
|
||||
echo "Runner: ${RUNNER_NAME:-$(hostname)} | User: $(whoami)"
|
||||
|
||||
- name: Download backend environment
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -374,90 +223,11 @@ jobs:
|
||||
run: |
|
||||
echo "=== Restoring Python Environment ==="
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
|
||||
# Verify the environment is available
|
||||
cd backend
|
||||
if [ -d ".venv" ]; then
|
||||
echo "✓ Python virtual environment found"
|
||||
. .venv/bin/activate
|
||||
echo "Python version: $(python --version)"
|
||||
echo "Virtual environment: $VIRTUAL_ENV"
|
||||
uv pip list
|
||||
else
|
||||
echo "❌ Virtual environment not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Run tests with pytest
|
||||
working-directory: ./backend
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
[ -d ".venv" ] || { echo "❌ Virtual environment not found"; exit 1; }
|
||||
. .venv/bin/activate
|
||||
|
||||
echo "=== Running Backend Tests ==="
|
||||
|
||||
# Run pytest with automatic typeguard hooks and coverage
|
||||
python -m pytest tests/ -v \
|
||||
--cov=backend \
|
||||
--cov-report=term-missing \
|
||||
--cov-report=xml \
|
||||
--cov-fail-under=95
|
||||
|
||||
echo "✓ Backend tests completed with automatic typeguard hooks and 95% coverage!"
|
||||
|
||||
- name: Install Python 3.13
|
||||
run: |
|
||||
# Add deadsnakes PPA for Python 3.13
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y software-properties-common
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa -y
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python3.13 python3.13-venv python3.13-dev curl git
|
||||
|
||||
- name: Install uv
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Verify installations
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
python3.13 --version
|
||||
uv --version
|
||||
|
||||
- name: Setup Python environment with uv
|
||||
working-directory: ./backend
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
echo "=== Setting up Python environment with uv ==="
|
||||
|
||||
# Check if we have a proper pyproject.toml
|
||||
if [ -f pyproject.toml ]; then
|
||||
echo "Found pyproject.toml, validating structure..."
|
||||
cat pyproject.toml
|
||||
echo "---"
|
||||
else
|
||||
echo "No pyproject.toml found, this should not happen"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create virtual environment
|
||||
echo "Creating virtual environment..."
|
||||
uv venv .venv --python python3.13
|
||||
|
||||
# Activate environment and install dev dependencies
|
||||
echo "Installing project with dev dependencies..."
|
||||
. .venv/bin/activate
|
||||
uv pip install -e ".[dev]"
|
||||
|
||||
# Verify installation
|
||||
echo "Verifying Python environment..."
|
||||
python --version
|
||||
python -c "import backend; print(f'Backend version: {backend.__version__}')"
|
||||
|
||||
# Show installed packages
|
||||
echo "Installed packages:"
|
||||
uv pip list
|
||||
echo "✓ Python $(python --version | cut -d' ' -f2) environment restored"
|
||||
|
||||
- name: Run tests with pytest
|
||||
working-directory: ./backend
|
||||
@@ -484,20 +254,8 @@ jobs:
|
||||
steps:
|
||||
- name: Runner Info
|
||||
run: |
|
||||
echo "==================== FRONTEND TESTS JOB RUNNER INFO ===================="
|
||||
echo "Job: frontend-tests"
|
||||
echo "Runner OS: $(uname -a)"
|
||||
echo "Hostname: $(hostname)"
|
||||
echo "Runner User: $(whoami)"
|
||||
echo "Runner Home: $HOME"
|
||||
echo "Working Directory: $(pwd)"
|
||||
echo "Runner IP: $(hostname -I 2>/dev/null || echo 'IP not available')"
|
||||
echo "Container ID: $(cat /proc/self/cgroup 2>/dev/null | head -1 | cut -d'/' -f3 || echo 'Not in container')"
|
||||
echo "Available CPU cores: $(nproc)"
|
||||
echo "Available Memory: $(free -h | grep '^Mem:' | awk '{print $2}' || echo 'Memory info not available')"
|
||||
echo "Disk space: $(df -h . | tail -1 | awk '{print $4}' || echo 'Disk info not available')"
|
||||
echo "Runner started at: $(date)"
|
||||
echo "========================================================================"
|
||||
echo "=== Frontend Tests - $(date) ==="
|
||||
echo "Runner: ${RUNNER_NAME:-$(hostname)} | User: $(whoami)"
|
||||
|
||||
- name: Download frontend environment
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -509,33 +267,22 @@ jobs:
|
||||
run: |
|
||||
echo "=== Restoring Node.js Environment ==="
|
||||
|
||||
# Verify Node.js is available (artifacts don't include system packages)
|
||||
# Install Node.js and corepack if not available
|
||||
if ! command -v node &> /dev/null; then
|
||||
echo "Installing Node.js 24..."
|
||||
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
fi
|
||||
|
||||
if ! command -v corepack &> /dev/null; then
|
||||
echo "Enabling corepack..."
|
||||
sudo npm install -g corepack
|
||||
corepack enable
|
||||
fi
|
||||
|
||||
# Verify environment
|
||||
# Verify environment and build artifacts
|
||||
cd frontend
|
||||
echo "Node version: $(node --version)"
|
||||
echo "Yarn version: $(yarn --version)"
|
||||
|
||||
# Verify build artifacts
|
||||
if [ -d "dist" ]; then
|
||||
echo "✓ Frontend build found"
|
||||
echo "Build contents:"
|
||||
ls -la dist/
|
||||
else
|
||||
echo "❌ Frontend build not found"
|
||||
exit 1
|
||||
fi
|
||||
echo "✓ Node $(node --version) | Yarn $(yarn --version)"
|
||||
[ -d "dist" ] || { echo "❌ Frontend build not found"; exit 1; }
|
||||
echo "✓ Build artifacts found ($(du -sh dist/ | cut -f1))"
|
||||
|
||||
- name: Run frontend tests
|
||||
working-directory: ./frontend
|
||||
@@ -546,77 +293,3 @@ jobs:
|
||||
yarn run test --coverage --coverage.enabled=true --coverage.thresholds.lines=85 --coverage.thresholds.functions=85 --coverage.thresholds.branches=85 --coverage.thresholds.statements=85
|
||||
|
||||
echo "✓ Frontend tests completed with automatic Zod validation hooks and 85% coverage!"
|
||||
|
||||
- name: Install Node.js 24
|
||||
run: |
|
||||
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
|
||||
- name: Setup Yarn Berry
|
||||
run: |
|
||||
corepack enable
|
||||
corepack prepare yarn@stable --activate
|
||||
|
||||
- name: Verify Node and Yarn
|
||||
run: |
|
||||
node --version
|
||||
yarn --version
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./frontend
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
echo "=== Frontend Dependency Installation ==="
|
||||
|
||||
# Initialize yarn berry and allow lockfile creation
|
||||
yarn set version stable
|
||||
|
||||
# Configure yarn for faster, more reliable installation
|
||||
echo "enableImmutableInstalls: false" > .yarnrc.yml
|
||||
echo "nodeLinker: pnp" >> .yarnrc.yml
|
||||
echo "compressionLevel: 0" >> .yarnrc.yml
|
||||
echo "httpTimeout: 60000" >> .yarnrc.yml
|
||||
|
||||
# Add packageManager field to package.json to avoid warnings
|
||||
if ! grep -q '"packageManager"' package.json; then
|
||||
# Add packageManager field before the closing brace
|
||||
sed -i '$ s/}/ "packageManager": "yarn@4.10.3",\n}/' package.json
|
||||
fi
|
||||
|
||||
# Install all dependencies from package.json
|
||||
echo "Installing dependencies from package.json..."
|
||||
yarn install
|
||||
|
||||
echo "Dependencies installation complete"
|
||||
echo "Yarn Berry setup successful"
|
||||
|
||||
- name: Verify TypeScript and Vue installation
|
||||
working-directory: ./frontend
|
||||
run: |
|
||||
echo "=== Verifying Frontend Environment ==="
|
||||
|
||||
# Check that key packages are available
|
||||
echo "Checking installed packages..."
|
||||
yarn info vue || echo "Vue check completed"
|
||||
yarn info typescript || echo "TypeScript check completed"
|
||||
yarn info @vitejs/plugin-vue || echo "Vue plugin check completed"
|
||||
|
||||
# Try TypeScript compilation if available
|
||||
echo "Attempting TypeScript type checking..."
|
||||
yarn type-check || echo "Type check completed (may have used fallback script)"
|
||||
|
||||
- name: Build frontend
|
||||
working-directory: ./frontend
|
||||
run: |
|
||||
echo "=== Building Frontend ==="
|
||||
yarn build || echo "Build completed (may have used fallback script)"
|
||||
|
||||
- name: Run frontend tests
|
||||
working-directory: ./frontend
|
||||
run: |
|
||||
echo "=== Running Frontend Tests ==="
|
||||
|
||||
# Run Vitest tests with coverage
|
||||
yarn test:coverage
|
||||
|
||||
echo "✓ Frontend tests completed with automatic Zod validation hooks and 85% coverage!"
|
||||
|
||||
Reference in New Issue
Block a user