diff --git a/.gitea/workflows/test-working-v2.yml b/.gitea/workflows/test-working-v2.yml new file mode 100644 index 0000000..fa46856 --- /dev/null +++ b/.gitea/workflows/test-working-v2.yml @@ -0,0 +1,133 @@ +name: Working CI v2 + +on: + push: + branches: [ main, develop, feature/* ] + pull_request: + branches: [ main, develop ] + +jobs: + backend-tests: + name: Backend Tests (Python) + runs-on: ubuntu-latest + container: python:3.13-slim + + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_PASSWORD: test_password + POSTGRES_USER: test_user + POSTGRES_DB: test_db + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Install git and basic tools + run: | + apt-get update + apt-get install -y git curl + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Verify checkout + run: | + echo "=== Verifying repository checkout ===" + pwd + ls -la + echo "Backend directory exists: $(test -d backend && echo 'yes' || echo 'no')" + if [ -d backend ]; then + echo "Backend contents:" + ls -la backend/ + echo "pyproject.toml exists: $(test -f backend/pyproject.toml && echo 'yes' || echo 'no')" + fi + + - name: Install uv + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.cargo/bin:$PATH" + uv --version + + - name: Setup backend environment + run: | + export PATH="$HOME/.cargo/bin:$PATH" + cd backend + echo "=== Setting up Python environment ===" + uv venv + source .venv/bin/activate + echo "Virtual environment activated" + echo "Installing dependencies..." + uv pip install -e . + echo "Dependencies installed" + echo "Verifying installation:" + python -c "import backend; print('Backend module imported successfully')" + + - name: Run backend tests with coverage and typeguard + run: | + export PATH="$HOME/.cargo/bin:$PATH" + cd backend + source .venv/bin/activate + echo "=== Running backend tests ===" + python -m pytest tests/ -v \ + --cov=src \ + --cov-report=html \ + --cov-report=term \ + --typeguard-packages=backend,src + env: + DATABASE_URL: postgresql://test_user:test_password@postgres:5432/test_db + + frontend-tests: + name: Frontend Tests (TypeScript/Vue) + runs-on: ubuntu-latest + container: node:20-slim + + steps: + - name: Install git and basic tools + run: | + apt-get update + apt-get install -y git curl + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Verify checkout + run: | + echo "=== Verifying repository checkout ===" + pwd + ls -la + echo "Frontend directory exists: $(test -d frontend && echo 'yes' || echo 'no')" + if [ -d frontend ]; then + echo "Frontend contents:" + ls -la frontend/ + echo "package.json exists: $(test -f frontend/package.json && echo 'yes' || echo 'no')" + fi + + - name: Install yarn + run: | + npm install -g yarn + yarn --version + + - name: Setup frontend environment + run: | + cd frontend + echo "=== Installing frontend dependencies ===" + yarn install --frozen-lockfile + echo "Dependencies installed" + echo "Verifying installation:" + yarn list --depth=0 + + - name: Run frontend type checking + run: | + cd frontend + echo "=== Running type checking ===" + yarn type-check + + - name: Run frontend tests with coverage + run: | + cd frontend + echo "=== Running frontend tests ===" + yarn test:unit --coverage