Skip to content

Optimize CI/CD workflows: add timeouts, reduce overhead, improve caching#231

Merged
mobilemind merged 7 commits into
mainfrom
copilot/optimize-ci-cd-workflow
Dec 24, 2025
Merged

Optimize CI/CD workflows: add timeouts, reduce overhead, improve caching#231
mobilemind merged 7 commits into
mainfrom
copilot/optimize-ci-cd-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 24, 2025

Optimize CI/CD workflows for faster feedback cycles and reduced execution overhead in this zero-dependency package.

Changes

Timeout Limits

  • Add timeout-minutes: 10 to CI, linter, and publish workflow jobs for fast failure
  • Add timeout-minutes: 15 to CodeQL workflow job (increased to provide adequate time for security analysis)

Workflow Optimizations

  • linter.yml: Cache ~/.npm directory to avoid re-downloading ESLint packages on every run
    • Uses manual versioning (eslint-v1) for controlled cache invalidation
    • Added Node.js setup step for proper caching integration
  • publish.yml: Consolidate npm upgrade and version verification into single step

Dependabot Configuration

  • Keep npm checks at monthly frequency (more conservative approach)
  • Reduce npm open-pull-requests-limit from 5 to 2
  • Maintain monthly GitHub Actions updates at existing 5 PR limit
# Before: separate steps
- name: "Upgrade npm for OIDC support"
  run: npm install -g npm@latest
- name: "Verify npm version"
  run: |
    NPM_VERSION=$(npm --version)
    # ... verification logic

# After: consolidated
- name: "Upgrade npm and verify OIDC support"
  run: |
    npm install -g npm@latest
    NPM_VERSION=$(npm --version)
    # ... verification logic
Original prompt

To improve the CI/CD workflow for the zero-dependency package repository mobilemind/text2datauri, the following tasks must be performed:\n\n1. Place explicit 10-minute timeout limits on all workflow jobs to ensure that they fail fast and provide quicker feedback cycles.\n2. Reduce execution overhead by consolidating redundant steps within the workflow files. If there are multiple steps that perform similar tasks or unnecessary operations, they should be combined or removed, ensuring no loss of functionality.\n3. Optimize the job configurations to speed up execution (e.g., reusing setup processes, minimizing job dependencies, and using caching wherever applicable).\n4. Revise the dependabot configuration for a zero-dependency package:\n - Verify that updates for any dev-only tools (like linters) are configured appropriately.\n - Ensure the configuration avoids unnecessary dependency checks.\n\nThe optimized workflow and configuration should maintain readability and ensure compatibility across relevant environments.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Dec 24, 2025
Copilot AI and others added 3 commits December 24, 2025 01:52
- Add 10-minute timeout to all workflow jobs for fast failure
- Add ESLint dependency caching in linter workflow
- Consolidate npm upgrade steps in publish workflow
- Optimize dependabot config for zero-dependency package

Co-authored-by: mobilemind <19366+mobilemind@users.noreply.github.com>
- Use stable cache key for ESLint dependencies
- Remove unnecessary blank line in publish workflow

Co-authored-by: mobilemind <19366+mobilemind@users.noreply.github.com>
- Cache npm's cache directory instead of node_modules
- Use manual version in cache key for controlled invalidation
- Always run install (fast with cached packages)
- Add restore-keys for partial cache hits

Co-authored-by: mobilemind <19366+mobilemind@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve CI/CD workflow for mobilemind/text2datauri Optimize CI/CD workflows: add timeouts, reduce overhead, improve caching Dec 24, 2025
Copilot AI requested a review from mobilemind December 24, 2025 01:56
Copy link
Copy Markdown
Owner

@mobilemind mobilemind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer monthly checks as more conservative.

Comment thread .github/dependabot.yml Outdated
Comment thread .github/dependabot.yml Outdated
- Change interval from quarterly back to monthly per user feedback
- Update comment to reflect monthly frequency
- Keep open-pull-requests-limit at 2 for optimization

Co-authored-by: mobilemind <19366+mobilemind@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 24, 2025

I prefer monthly checks as more conservative.

Reverted to monthly checks in commit 764ce22. The interval is now back to monthly as originally configured.

@mobilemind mobilemind marked this pull request as ready for review December 24, 2025 02:05
Copilot AI review requested due to automatic review settings December 24, 2025 02:05
Copilot AI requested a review from mobilemind December 24, 2025 02:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes CI/CD workflows for a zero-dependency package by adding timeout limits, consolidating redundant workflow steps, and implementing caching strategies to reduce execution time.

Key Changes:

  • Added 10-minute timeout limits to all workflow jobs (ci.yml, linter.yml, codeql-analysis.yml, publish.yml)
  • Consolidated npm upgrade and verification steps in publish.yml into a single step
  • Added Node.js setup and npm caching to linter.yml to speed up ESLint installation

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/ci.yml Added 10-minute timeout to build job
.github/workflows/linter.yml Added timeout, Node.js setup, and npm caching for ESLint dependencies
.github/workflows/codeql-analysis.yml Added 10-minute timeout to analyze job
.github/workflows/publish.yml Added timeout and consolidated npm upgrade/verification into single step
.github/dependabot.yml Reduced npm open-pull-requests-limit from 5 to 2

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/linter.yml Outdated
Comment thread .github/workflows/linter.yml Outdated
Comment thread .github/workflows/codeql-analysis.yml Outdated
Copy link
Copy Markdown
Owner

@mobilemind mobilemind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Let's merge it.

Copy link
Copy Markdown
Owner

@mobilemind mobilemind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like a minor change.

Comment thread .github/workflows/codeql-analysis.yml Outdated
- Change timeout from 10 to 15 minutes per user feedback
- 50% increase provides better margin for CodeQL analysis

Co-authored-by: mobilemind <19366+mobilemind@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Owner

@mobilemind mobilemind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@mobilemind mobilemind enabled auto-merge December 24, 2025 02:27
@mobilemind mobilemind disabled auto-merge December 24, 2025 02:27
Copy link
Copy Markdown
Owner

@mobilemind mobilemind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@mobilemind mobilemind enabled auto-merge December 24, 2025 02:28
Copy link
Copy Markdown
Owner

@mobilemind mobilemind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@mobilemind mobilemind disabled auto-merge December 24, 2025 02:46
@mobilemind mobilemind enabled auto-merge December 24, 2025 02:46
@mobilemind mobilemind disabled auto-merge December 24, 2025 02:57
@mobilemind mobilemind merged commit c17bf65 into main Dec 24, 2025
7 checks passed
@mobilemind mobilemind deleted the copilot/optimize-ci-cd-workflow branch December 24, 2025 02:58
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.

3 participants