Skip to content

Speed up CI by caching npm early and skipping docs-only runs#536

Open
Codex wants to merge 2 commits intomainfrom
codex/optimize-ci-pipeline-runtime
Open

Speed up CI by caching npm early and skipping docs-only runs#536
Codex wants to merge 2 commits intomainfrom
codex/optimize-ci-pipeline-runtime

Conversation

@Codex
Copy link
Copy Markdown

@Codex Codex AI commented Mar 2, 2026

CI currently spins up heavy FalkorDB docker stacks and runs full tests on every change, even docs-only edits, leading to slow wall-clock time.

  • CI workflow
    • Add path ignores for markdown/docs to avoid unnecessary CI on docs-only changes.
    • Move Node setup/npm cache/npm ci ahead of docker services to fail fast and reuse deps (cache-dependency-path: package-lock.json).
    • Run lint/build once on Node 22; keep matrix for tests with fail-fast enabled; drop redundant docker-compose install.
  • Spellcheck workflow
    • Restrict triggers to markdown/docs paths only.

Example (CI trigger filters):

on:
  push:
    branches: [ "main" ]
    paths-ignore:
      - '**/*.md'
      - 'docs/**'
  pull_request:
    branches: [ "main" ]
    paths-ignore:
      - '**/*.md'
      - 'docs/**'

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • sentinel-1
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/falkordb-ts/falkordb-ts/node_modules/.bin/jest --runInBand (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Optimize CI Pipeline to Reduce Runtime</issue_title>
<issue_description>## Optimize CI Pipeline to Reduce Runtime

Goal

Analyze and optimize the CI/CD pipeline configuration(s) in this repository to significantly reduce overall CI runtime, while maintaining correctness and test coverage.

Context

Our CI pipeline is taking longer than necessary. We want to reduce wall-clock time for CI runs by applying industry best practices for CI performance optimization.

Instructions for the Coding Agent

Please analyze all CI/CD configuration files in this repository (e.g., .github/workflows/*.yml, .circleci/config.yml, Jenkinsfile, .gitlab-ci.yml, azure-pipelines.yml, etc.) and apply the following optimizations where applicable:

1. Caching

  • Add or improve caching for package managers (npm, pip, maven, gradle, cargo, go modules, bundler, etc.).
  • Add or improve caching for build artifacts, compiled outputs, and intermediate files.
  • Ensure cache keys are based on lockfiles or dependency hashes for correctness.

2. Parallelism

  • Split large test suites into parallel jobs using matrix strategies or test-splitting tools.
  • Run independent jobs concurrently instead of sequentially where possible.
  • Use needs: / dependency graphs to ensure jobs only wait on actual dependencies.

3. Job & Step Optimization

  • Remove redundant or unnecessary steps (e.g., duplicate installs, unnecessary checkouts).
  • Combine small sequential steps that can be merged.
  • Use shallow clones (fetch-depth: 1) for checkouts where full history is not required.
  • Skip unnecessary jobs on certain triggers (e.g., skip deploy on PRs, skip heavy tests on docs-only changes) using path filters or conditional execution.

4. Docker & Container Optimization

  • Use pre-built Docker images with dependencies baked in, instead of installing them at runtime.
  • Use multi-stage builds to reduce image size where applicable.
  • Cache Docker layers where possible.

5. Dependency Installation

  • Use frozen/locked installs (npm ci, pip install --no-deps, bundle install --frozen, etc.) which are faster than resolver-based installs.
  • Avoid installing dev/test dependencies in jobs that don't need them.

6. Tool & Action Versions

  • Pin to latest stable versions of actions/tools which may include performance improvements.
  • Use native/built-in features of the CI platform over custom scripts when faster.

7. Fail Fast

  • Enable fail-fast strategies so the pipeline stops early on failure.
  • Move linting and static analysis to run first/in parallel since they are typically fast and catch errors early.

Constraints

  • Do not reduce test coverage or remove meaningful tests.
  • Do not break existing functionality — all currently passing checks must continue to pass.
  • Preserve all existing triggers (push, PR, schedule, etc.) unless a change is clearly safe and beneficial.
  • Ensure all changes are backward-compatible with the current branch structure and workflows.

Deliverables

  • Modified CI configuration file(s) with optimizations applied.
  • A summary (in the PR description) of each optimization made and its expected
    </issue_description>

Comments on the Issue (you are @codex[agent] in this section)

@Codex Codex AI changed the title [WIP] Optimize CI pipeline to reduce runtime Speed up CI by caching npm early and skipping docs-only runs Mar 2, 2026
@gkorland gkorland marked this pull request as ready for review March 2, 2026 16:16
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.11%. Comparing base (343e2ed) to head (667393f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #536   +/-   ##
=======================================
  Coverage   97.11%   97.11%           
=======================================
  Files          27       27           
  Lines        2113     2113           
  Branches      303      303           
=======================================
  Hits         2052     2052           
  Misses         60       60           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize CI Pipeline to Reduce Runtime

2 participants