Fixing the optimization
Some checks failed
Tests / Build and Push CICD Base Image (push) Failing after 23m13s
Tests / Build and Push CICD Complete Image (push) Has been skipped
Tests / Trailing Whitespace Check (push) Has been skipped
Tests / Pyright Type Check (push) Has been skipped
Tests / End of File Check (push) Has been skipped
Tests / YAML Syntax Check (push) Has been skipped
Tests / TOML Syntax Check (push) Has been skipped
Tests / Mixed Line Ending Check (push) Has been skipped
Tests / TOML Formatting Check (push) Has been skipped
Tests / Ruff Linting (push) Has been skipped
Tests / Ruff Format Check (push) Has been skipped
Tests / Darglint Docstring Check (push) Has been skipped
Tests / No Docstring Types Check (push) Has been skipped
Tests / ESLint Check (push) Has been skipped
Tests / Prettier Format Check (push) Has been skipped
Tests / TypeScript Type Check (push) Has been skipped
Tests / TSDoc Lint Check (push) Has been skipped
Tests / Backend Tests (push) Has been skipped
Tests / Frontend Tests (push) Has been skipped
Tests / Backend Doctests (push) Has been skipped
Tests / End-to-End Tests (push) Has been skipped
Tests / Integration Tests (push) Has been skipped
Some checks failed
Tests / Build and Push CICD Base Image (push) Failing after 23m13s
Tests / Build and Push CICD Complete Image (push) Has been skipped
Tests / Trailing Whitespace Check (push) Has been skipped
Tests / Pyright Type Check (push) Has been skipped
Tests / End of File Check (push) Has been skipped
Tests / YAML Syntax Check (push) Has been skipped
Tests / TOML Syntax Check (push) Has been skipped
Tests / Mixed Line Ending Check (push) Has been skipped
Tests / TOML Formatting Check (push) Has been skipped
Tests / Ruff Linting (push) Has been skipped
Tests / Ruff Format Check (push) Has been skipped
Tests / Darglint Docstring Check (push) Has been skipped
Tests / No Docstring Types Check (push) Has been skipped
Tests / ESLint Check (push) Has been skipped
Tests / Prettier Format Check (push) Has been skipped
Tests / TypeScript Type Check (push) Has been skipped
Tests / TSDoc Lint Check (push) Has been skipped
Tests / Backend Tests (push) Has been skipped
Tests / Frontend Tests (push) Has been skipped
Tests / Backend Doctests (push) Has been skipped
Tests / End-to-End Tests (push) Has been skipped
Tests / Integration Tests (push) Has been skipped
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
@@ -68,10 +68,11 @@ RUN cd /workspace && \
|
||||
WORKDIR /workspace/frontend
|
||||
|
||||
# Install frontend dependencies with optimized approach
|
||||
# Many development tools are already installed globally in base image
|
||||
# Many development tools are already installed globally in base image via npm
|
||||
RUN echo "=== Setting up optimized frontend environment ===" && \
|
||||
echo "Available global tools:" && \
|
||||
yarn global list --depth=0 2>/dev/null || echo "Global tools listed above" && \
|
||||
echo "Available global tools (installed via npm):" && \
|
||||
npm list -g --depth=0 2>/dev/null | head -10 || echo "Global npm tools available" && \
|
||||
which tsc && which eslint && which prettier && which playwright || echo "Global tools verified" && \
|
||||
# Create temporary swap file for memory-intensive yarn install
|
||||
dd if=/dev/zero of=/tmp/swapfile bs=1M count=1024 2>/dev/null && \
|
||||
mkswap /tmp/swapfile && \
|
||||
@@ -111,10 +112,10 @@ RUN if [ -f ".frontend-deps-failed" ]; then \
|
||||
echo "Frontend dependencies failed - Playwright E2E tests will be skipped"; \
|
||||
elif grep -q '@playwright/test' package.json && [ -d "node_modules" ]; then \
|
||||
echo "Verifying Playwright browsers from base image..." && \
|
||||
# Verify global Playwright CLI is working
|
||||
yarn playwright --version && \
|
||||
# Verify global Playwright CLI is working (installed via npm globally)
|
||||
playwright --version && \
|
||||
# Verify browsers are installed (they should be from base image)
|
||||
yarn playwright install --dry-run chromium firefox webkit || \
|
||||
playwright install --dry-run chromium firefox webkit || \
|
||||
echo "Note: Using globally installed browsers from base image" && \
|
||||
echo "✓ Playwright browsers available from base image"; \
|
||||
else \
|
||||
|
||||
@@ -104,28 +104,33 @@ RUN yarn config set httpTimeout 60000 && \
|
||||
# Install uv package manager globally
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
|
||||
|
||||
# Install common development tools globally to improve CI performance
|
||||
# Install common development tools globally using npm (more reliable for global installs)
|
||||
RUN echo "=== Installing Global Development Tools ===" && \
|
||||
# Install common Node.js development tools globally
|
||||
yarn global add \
|
||||
@playwright/test \
|
||||
# Use npm for global installations (works better than yarn global in Berry)
|
||||
npm install -g \
|
||||
@playwright/test@1.40.0 \
|
||||
typescript@5.3.3 \
|
||||
eslint@9.33.0 \
|
||||
prettier@3.3.3 \
|
||||
vite@7.1.10 \
|
||||
@types/node@20.16.0 && \
|
||||
echo "✓ Global Node.js development tools installed"
|
||||
# Verify global tools are available
|
||||
which playwright && \
|
||||
which tsc && \
|
||||
which eslint && \
|
||||
which prettier && \
|
||||
echo "✓ Global Node.js development tools installed via npm"
|
||||
|
||||
# Install Playwright browsers for E2E testing
|
||||
# This downloads ~400MB+ of browser binaries that will be cached
|
||||
RUN echo "=== Installing Playwright Browsers ===" && \
|
||||
# Verify Playwright CLI is available
|
||||
yarn playwright --version && \
|
||||
playwright --version && \
|
||||
# Install browsers with system dependencies (non-interactive)
|
||||
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 && \
|
||||
yarn playwright install --with-deps chromium firefox webkit && \
|
||||
# Verify browsers are installed
|
||||
yarn playwright install-deps && \
|
||||
playwright install --with-deps chromium firefox webkit && \
|
||||
# Install system dependencies for browsers
|
||||
playwright install-deps && \
|
||||
echo "✓ Playwright browsers installed and cached in base image"
|
||||
|
||||
# Pre-install common Python development dependencies globally
|
||||
@@ -169,10 +174,10 @@ RUN echo "=== Base System Verification ===" && \
|
||||
uv --version && \
|
||||
git --version && \
|
||||
echo "=== Global Development Tools Verification ===" && \
|
||||
yarn playwright --version && \
|
||||
yarn tsc --version && \
|
||||
yarn eslint --version && \
|
||||
yarn prettier --version && \
|
||||
playwright --version && \
|
||||
tsc --version && \
|
||||
eslint --version && \
|
||||
prettier --version && \
|
||||
/opt/python-dev-tools/bin/ruff --version && \
|
||||
/opt/python-dev-tools/bin/pyright --version && \
|
||||
/opt/python-dev-tools/bin/pytest --version && \
|
||||
|
||||
@@ -59,14 +59,13 @@ This project uses a two-stage Docker build approach to optimize CI/CD performanc
|
||||
- `pre-commit` - Git hook framework
|
||||
- `yamllint`, `toml-sort` - Configuration file tools
|
||||
|
||||
**Node.js Tools** (installed globally):
|
||||
**Node.js Tools** (installed globally via npm):
|
||||
- `@playwright/test` - Playwright testing framework
|
||||
- `typescript` - TypeScript compiler
|
||||
- `eslint` - JavaScript/TypeScript linter
|
||||
- `prettier` - Code formatter
|
||||
- `vite` - Build tool
|
||||
- `@types/node` - Node.js type definitions
|
||||
|
||||
**Benefits**:
|
||||
- `@types/node` - Node.js type definitions**Benefits**:
|
||||
- **Compilation Cache**: No more compiling these tools from source
|
||||
- **Dependency Resolution**: Faster yarn/uv install due to fewer packages
|
||||
- **Network Efficiency**: Less download bandwidth per build
|
||||
|
||||
@@ -198,10 +198,10 @@ test_images() {
|
||||
docker run --rm "$BASE_IMAGE_TAG" node --version && \
|
||||
docker run --rm "$BASE_IMAGE_TAG" yarn --version && \
|
||||
docker run --rm "$BASE_IMAGE_TAG" uv --version && \
|
||||
docker run --rm "$BASE_IMAGE_TAG" yarn playwright --version; then
|
||||
log_success "Base image tests passed (includes Playwright)"
|
||||
docker run --rm "$BASE_IMAGE_TAG" playwright --version; then
|
||||
log_success "Base image tests passed (includes Playwright via npm)"
|
||||
# Test that browsers are installed
|
||||
if docker run --rm "$BASE_IMAGE_TAG" yarn playwright install --dry-run chromium >/dev/null 2>&1; then
|
||||
if docker run --rm "$BASE_IMAGE_TAG" playwright install --dry-run chromium >/dev/null 2>&1; then
|
||||
log_success "Playwright browsers verified in base image"
|
||||
else
|
||||
log_warning "Playwright browsers may not be fully installed in base image"
|
||||
|
||||
Reference in New Issue
Block a user