Starting the setup of a multi-stage CICD workflow.
Some checks failed
Tests / Setup and Checkout (push) Failing after 1m32s
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 / Frontend Tests (TypeScript + Vue + Yarn Berry) (push) Has been skipped
Some checks failed
Tests / Setup and Checkout (push) Failing after 1m32s
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 / Frontend Tests (TypeScript + Vue + Yarn Berry) (push) Has been skipped
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
@@ -12,9 +12,28 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
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 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 "SSH client version:"
|
||||
ssh -V 2>&1 || echo "SSH not available"
|
||||
|
||||
@@ -22,9 +41,7 @@ jobs:
|
||||
ls -la ~/.ssh/ 2>/dev/null || echo "No ~/.ssh directory"
|
||||
|
||||
echo "Checking for SSH keys in common locations:"
|
||||
find ~ -name "id_*" -type f 2>/dev/null || echo "No SSH keys found in home directory"
|
||||
find /root -name "id_*" -type f 2>/dev/null || echo "No SSH keys found in /root"
|
||||
find /data -name "id_*" -type f 2>/dev/null || echo "No SSH keys found in /data"
|
||||
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"
|
||||
@@ -98,18 +115,294 @@ jobs:
|
||||
!.git
|
||||
retention-days: 1
|
||||
|
||||
backend-tests:
|
||||
name: Backend Tests (Python 3.13 + uv)
|
||||
backend-setup:
|
||||
name: Backend Setup (Python 3.13 + uv + Environment)
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
|
||||
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 "========================================================================"
|
||||
|
||||
- name: Download source code
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: source-code
|
||||
path: .
|
||||
|
||||
- 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 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: |
|
||||
echo "=== Installing uv Package Manager ==="
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Verify installations
|
||||
run: |
|
||||
echo "=== Verifying Python and uv Installations ==="
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
python3.13 --version
|
||||
uv --version
|
||||
echo "✓ Python 3.13 and uv successfully installed"
|
||||
|
||||
- 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 "✓ Backend environment setup complete"
|
||||
|
||||
- name: Upload backend environment
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: backend-environment
|
||||
path: |
|
||||
.
|
||||
!.git
|
||||
retention-days: 1
|
||||
|
||||
frontend-setup:
|
||||
name: Frontend Setup (Node.js 24 + Yarn Berry + Build)
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
|
||||
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 "========================================================================"
|
||||
|
||||
- name: Download source code
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: source-code
|
||||
path: .
|
||||
|
||||
- name: Install Node.js 24
|
||||
run: |
|
||||
echo "=== Installing Node.js 24 ==="
|
||||
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
|
||||
- name: Setup Yarn Berry
|
||||
run: |
|
||||
echo "=== Setting up Yarn Berry ==="
|
||||
corepack enable
|
||||
corepack prepare yarn@stable --activate
|
||||
|
||||
- name: Verify Node and Yarn
|
||||
run: |
|
||||
echo "=== Verifying Node.js and Yarn Installations ==="
|
||||
node --version
|
||||
yarn --version
|
||||
echo "✓ Node.js 24 and Yarn Berry successfully installed"
|
||||
|
||||
- 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 dependencies
|
||||
echo "Installing dependencies with Yarn Berry..."
|
||||
yarn install
|
||||
|
||||
echo "✓ Frontend dependencies installed successfully"
|
||||
|
||||
- name: Verify TypeScript and Vue
|
||||
working-directory: ./frontend
|
||||
run: |
|
||||
echo "=== Verifying TypeScript and Vue Setup ==="
|
||||
|
||||
# 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
|
||||
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"
|
||||
|
||||
- name: Upload frontend environment
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: frontend-environment
|
||||
path: |
|
||||
.
|
||||
!.git
|
||||
retention-days: 1
|
||||
|
||||
backend-tests:
|
||||
name: Backend Tests (Python 3.13 + uv)
|
||||
runs-on: ubuntu-latest
|
||||
needs: backend-setup
|
||||
|
||||
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 "========================================================================"
|
||||
|
||||
- name: Download backend environment
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: backend-environment
|
||||
path: .
|
||||
|
||||
- name: Restore Python environment
|
||||
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"
|
||||
. .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
|
||||
@@ -184,15 +477,74 @@ jobs:
|
||||
frontend-tests:
|
||||
name: Frontend Tests (TypeScript + Vue + Yarn Berry)
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
needs: frontend-setup
|
||||
|
||||
steps:
|
||||
- name: Download source code
|
||||
- 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 "========================================================================"
|
||||
|
||||
- name: Download frontend environment
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: source-code
|
||||
name: frontend-environment
|
||||
path: .
|
||||
|
||||
- name: Restore Node environment
|
||||
run: |
|
||||
echo "=== Restoring Node.js Environment ==="
|
||||
|
||||
# Verify Node.js is available (artifacts don't include system packages)
|
||||
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
|
||||
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
|
||||
|
||||
- name: Run frontend tests
|
||||
working-directory: ./frontend
|
||||
run: |
|
||||
echo "=== Running Frontend Tests ==="
|
||||
|
||||
# Run Vitest with automatic Zod validation hooks and coverage
|
||||
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 -
|
||||
|
||||
Reference in New Issue
Block a user