Skip to content

Question - How to cache builds on GHA? #2874

@arminrosu

Description

@arminrosu

Hello,

This is not an issue or bug report for node-gyp, this is a tired dev asking for help.

I'm trying to speed up our pipelines running on github actions. Currently yarn install takes about 1 minute, in a huge mono-repo. I'm already using actions/cache and checked actions/setup-node with the cache: yarn option as well, but couldn't bring down the yarn install time.

From what I can tell, the biggest time cost comes from 2 dependencies which run node-gyp every time. On CI, the Link step takes 1 minute. Locally, it's ~1s and node-gyp doesn't run (again)

I tried caching the builds and the global cache:

~/.cache/node-gyp
# Explicit caching of the affected packages
node_modules/cpu-features/build
node_modules/unix-dgram/build

I confirmed the build cache is correctly saved and restored, but node-gyp still runs.

Do you have any advice how I can skip running node-gyp on CI?

Thanks for your time and your great project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions