Skip to content

Conversation

@souhailaS
Copy link
Contributor

@souhailaS souhailaS commented Jul 15, 2025

Context

We conducted an analysis of the nodejs.yml workflow run history using GitHub API data from recent successful executions. The analysis revealed potential resource optimisation in setup steps across three static check jobs (typecheck, lint, yarn-validate), each performing identical dependency installation and environment setup.

Change

Combined three jobs into one static-checks job, eliminating redundant setup (installations and checkouts)

Impact

Based on the runs history this workflow. We could estimate:

  • Estimated time saved per run: 48.3 seconds
  • Setup overhead: 79s → 29s (63% reduction)
  • Estimated Annual savings: 35 hours (~$17)

Technical

  • All checks preserved
  • Same failure detection
  • No functionality loss

Files

  • .github/workflows/nodejs.yml

Additional Context

We are a team of researchers from University of Zurich (https://www.ifi.uzh.ch/en/zest.html) currently working on automating energy optimizations in GitHub Actions workflows. This optimization maintains full functionality while potentially reducing computational overhead and energy consumption.

souhaila.serbout@uzh.ch

Combine typecheck, lint, and yarn-validate jobs into a single static-checks job to eliminate duplication of setup steps and dependencies.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 15, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@netlify
Copy link

netlify bot commented Jul 15, 2025

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit b18b377
🔍 Latest deploy log https://app.netlify.com/projects/jestjs/deploys/68764e77f2173c0008ee478d
😎 Deploy Preview https://deploy-preview-15739--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@souhailaS souhailaS changed the title Deduplicate static checks in CI workflow [CI Energy Waste] Deduplicate static checks in CI workflow Jul 15, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 15, 2025

Open in StackBlitz

babel-jest

npm i https://pkg.pr.new/babel-jest@15739

babel-plugin-jest-hoist

npm i https://pkg.pr.new/babel-plugin-jest-hoist@15739

babel-preset-jest

npm i https://pkg.pr.new/babel-preset-jest@15739

create-jest

npm i https://pkg.pr.new/create-jest@15739

@jest/diff-sequences

npm i https://pkg.pr.new/@jest/diff-sequences@15739

expect

npm i https://pkg.pr.new/expect@15739

@jest/expect-utils

npm i https://pkg.pr.new/@jest/expect-utils@15739

jest

npm i https://pkg.pr.new/jest@15739

jest-changed-files

npm i https://pkg.pr.new/jest-changed-files@15739

jest-circus

npm i https://pkg.pr.new/jest-circus@15739

jest-cli

npm i https://pkg.pr.new/jest-cli@15739

jest-config

npm i https://pkg.pr.new/jest-config@15739

@jest/console

npm i https://pkg.pr.new/@jest/console@15739

@jest/core

npm i https://pkg.pr.new/@jest/core@15739

@jest/create-cache-key-function

npm i https://pkg.pr.new/@jest/create-cache-key-function@15739

jest-diff

npm i https://pkg.pr.new/jest-diff@15739

jest-docblock

npm i https://pkg.pr.new/jest-docblock@15739

jest-each

npm i https://pkg.pr.new/jest-each@15739

@jest/environment

npm i https://pkg.pr.new/@jest/environment@15739

jest-environment-jsdom

npm i https://pkg.pr.new/jest-environment-jsdom@15739

@jest/environment-jsdom-abstract

npm i https://pkg.pr.new/@jest/environment-jsdom-abstract@15739

jest-environment-node

npm i https://pkg.pr.new/jest-environment-node@15739

@jest/expect

npm i https://pkg.pr.new/@jest/expect@15739

@jest/fake-timers

npm i https://pkg.pr.new/@jest/fake-timers@15739

@jest/get-type

npm i https://pkg.pr.new/@jest/get-type@15739

@jest/globals

npm i https://pkg.pr.new/@jest/globals@15739

jest-haste-map

npm i https://pkg.pr.new/jest-haste-map@15739

jest-jasmine2

npm i https://pkg.pr.new/jest-jasmine2@15739

jest-leak-detector

npm i https://pkg.pr.new/jest-leak-detector@15739

jest-matcher-utils

npm i https://pkg.pr.new/jest-matcher-utils@15739

jest-message-util

npm i https://pkg.pr.new/jest-message-util@15739

jest-mock

npm i https://pkg.pr.new/jest-mock@15739

@jest/pattern

npm i https://pkg.pr.new/@jest/pattern@15739

jest-phabricator

npm i https://pkg.pr.new/jest-phabricator@15739

jest-regex-util

npm i https://pkg.pr.new/jest-regex-util@15739

@jest/reporters

npm i https://pkg.pr.new/@jest/reporters@15739

jest-resolve

npm i https://pkg.pr.new/jest-resolve@15739

jest-resolve-dependencies

npm i https://pkg.pr.new/jest-resolve-dependencies@15739

jest-runner

npm i https://pkg.pr.new/jest-runner@15739

jest-runtime

npm i https://pkg.pr.new/jest-runtime@15739

@jest/schemas

npm i https://pkg.pr.new/@jest/schemas@15739

jest-snapshot

npm i https://pkg.pr.new/jest-snapshot@15739

@jest/snapshot-utils

npm i https://pkg.pr.new/@jest/snapshot-utils@15739

@jest/source-map

npm i https://pkg.pr.new/@jest/source-map@15739

@jest/test-result

npm i https://pkg.pr.new/@jest/test-result@15739

@jest/test-sequencer

npm i https://pkg.pr.new/@jest/test-sequencer@15739

@jest/transform

npm i https://pkg.pr.new/@jest/transform@15739

@jest/types

npm i https://pkg.pr.new/@jest/types@15739

jest-util

npm i https://pkg.pr.new/jest-util@15739

jest-validate

npm i https://pkg.pr.new/jest-validate@15739

jest-watcher

npm i https://pkg.pr.new/jest-watcher@15739

jest-worker

npm i https://pkg.pr.new/jest-worker@15739

pretty-format

npm i https://pkg.pr.new/pretty-format@15739

commit: b18b377

@mrazauskas
Copy link
Contributor

mrazauskas commented Jul 16, 2025

  • Estimated Annual savings: 35 hours (~$17)

Can I ask how does this compares with an average annual tuition fee at the University of Zurich? (That is irony, of course. But I think the question is legit, because you titled this PR with: "Energy Waste". Do you see the point?)

@souhailaS
Copy link
Contributor Author

souhailaS commented Jul 16, 2025

@mrazauskas , indeed ... the question is ''legit''.

You're absolutely right that $17 won’t fund a semester at the University of Zurich but could plant a dozen trees. And while that may still sound minor, it’s symbolic of something larger.

GitHub nowadays hosts about 420 million repositories. If each of them approximately were to waste just one second of runner time per day, that would amount to 7 million minutes wasted daily. At GitHub's billing rate of $0.008 per minute, this seemingly minor inefficiency would result in over $56 000 per day, or even more than $20 million annually, in excess compute costs.

But the story is not about the financial dimension .. it's the env footprint: 1 s per repo per day would translate to roughly 2100 kWh wasted daily (for the basic ubuntu-latest runner), or about 730 000 kWh annually, equivalent to the yearly consumption of dozens of households in a developed country.

@mrazauskas
Copy link
Contributor

mrazauskas commented Jul 16, 2025

You are manipulating with numbers. That is it.

GitHub or any other responsible corporation should(!) and must(!) invest into education of upcoming developers. I am rather sure they do! (For instance, they do not take a penny from open source projects. These are in many case the learning projects, actually. What about the University of Zurich? Do they charge you for learning? Could you please calculate and provide the number of $ the University of Zurich is charging per day for everyone who, perhaps, wants to simply learn something new? Or everyone ate the university simply learning how to get more of $ per day / per hour / per whatever.)

That is not anyhow taken into account of your “research“. Really sorry about the question marks, but I still find it questionable. The numbers you provide are manipulative and not based on reality.

@mrazauskas
This comment was marked as a violation of GitHub Acceptable Use Policies
@souhailaS souhailaS changed the title [CI Energy Waste] Deduplicate static checks in CI workflow [CI] Deduplicate static checks in CI workflow Jul 16, 2025
@souhailaS souhailaS changed the title [CI] Deduplicate static checks in CI workflow [CI Energy Waste] Deduplicate static checks in CI workflow Jul 16, 2025
@cpojer cpojer merged commit 2a436b8 into jestjs:main Jul 18, 2025
74 checks passed
@cpojer
Copy link
Member

cpojer commented Jul 18, 2025

@souhailaS Thank you

@mrazauskas please spend some time reflecting on your conduct

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants