Skip to content

Update CI workflow #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

surilindur
Copy link
Contributor

This is a small set of changes to bump the actions versions, and to add better names to some of the steps:

  • Run tests on Node 22 instead of 21 (in addition to 18 and 20).
  • Cache the .yarn folder because that is the main one needed for Yarn version 4.
  • Wait for linting to finish before running unit tests. The CI is so short that this makes sense. If the CI is too slow, it is because Jest is running with too many workers, which will be fixed in another PR.
  • Ensure the Coveralls coverage is supplied the correct key, to avoid false duplicates in the report.
  • Cancel in-progress workflows when new commits are pushed to a branch.
  • Use the --immutable flag to detect any lockfile inconsistencies in the CI.

with:
path: '**/node_modules'
key: ${{ runner.os }}-test-modules-${{ hashFiles('**/yarn.lock') }}
path: .yarn
Copy link
Member

Choose a reason for hiding this comment

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

Why not cache node_modules anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the linking step (to unpack the downloaded packages into node_modules) is faster than the download step, so it is more efficient to cache the download cache of Yarn (located in .yarn). That way, Yarn can skip the download step, which is most expensive, and proceed to just comparing its local cache against the server versions, and then do unpacking.

Copy link
Member

Choose a reason for hiding this comment

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

But if we just cache node_modules, we don't have to 1) download, and 2) link. So it's more efficient to cache that, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it back to caching node_modules instead.

@rubensworks rubensworks merged commit 34b297c into LinkedSoftwareDependencies:master Mar 20, 2025
21 checks passed
@rubensworks
Copy link
Member

Thanks!

@surilindur surilindur deleted the chore/update-ci branch March 20, 2025 14: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.

2 participants