Giter Site home page Giter Site logo

rharkor / caching-for-turbo Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 5.0 4.25 MB

A Github action to set up Turborepo Remote Caching to work with GitHub Actions' built-in cache instead of Vercel one

License: MIT License

TypeScript 77.67% Shell 22.33%
cache ci monorepo remote-caching turbo turborepo

caching-for-turbo's People

Contributors

dependabot[bot] avatar renovate[bot] avatar rharkor avatar yamcodes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

yamcodes chase kyun

caching-for-turbo's Issues

Cannot find module `@actions/core`

CleanShot 2024-06-23 at 13 34 44@2x

We're facing a bug when using this in one of our composite actions.

We've added the following step before turbo build:

    - name: Cache for Turbo
      uses: rharkor/[email protected]

And the issue prevented the workflow from completion in GitHub Actions.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

devcontainer
.devcontainer/devcontainer.json
  • mcr.microsoft.com/devcontainers/typescript-node 22
  • ghcr.io/devcontainers/features/github-cli 1
  • ghcr.io/devcontainers-contrib/features/prettier 1
github-actions
.github/workflows/check-dist.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/codeql-analysis.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
nodenv
.node-version
  • node 20.16.0
npm
package.json
  • @actions/cache ^3.2.4
  • @actions/core ^1.10.1
  • fastify ^4.27.0
  • stream-to-promise ^3.0.0
  • wait-on ^7.2.0
  • @jest/globals ^29.7.0
  • @types/node ^20.14.2
  • @types/stream-to-promise ^2.2.4
  • @types/wait-on ^5.3.4
  • @typescript-eslint/eslint-plugin ^7.0.0
  • @typescript-eslint/parser ^7.0.0
  • @vercel/ncc ^0.38.1
  • eslint ^8.57.0
  • eslint-plugin-github ^5.0.1
  • eslint-plugin-jest ^28.6.0
  • eslint-plugin-jsonc ^2.16.0
  • eslint-plugin-prettier ^5.1.3
  • make-coverage-badge ^1.2.0
  • prettier ^3.3.2
  • prettier-eslint ^16.3.0
  • ts-jest ^29.1.4
  • tsx ^4.15.4
  • turbo ^2.0.3
  • typescript ^5.4.5
  • node >=20
  • npm 10.8.2

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (config:recommeded)

Error on Windows

For Windows, the log file is not created.

Error: ENOENT: no such file or directory, open 'D:\tmp\turbogha.log'
    at openSync (node:fs:573:18)
    at launchServer (D:\a\_actions\rharkor\caching-for-turbo\d030e8813d3de6746943c17def1f5643b1dd1e94\src\lib\server\utils.ts:28:1)
    at run (D:\a\_actions\rharkor\caching-for-turbo\d030e8813d3de6746943c17def1f5643b1dd1e94\src\main.ts:16:1)
    at D:\a\_actions\rharkor\caching-for-turbo\d030e8813d3de6746943c17def1f5643b1dd1e94\src\index.ts:7:1
    at D:\a\_actions\rharkor\caching-for-turbo\d030e8813d3de6746943c17def1f5643b1dd1e94\dist\index.js:1585[12](https://github.com/psychobolt/vite-storybook-boilerplate/actions/runs/9617119273/job/26528200184?pr=920#step:5:13):3
    at Object.<anonymous> (D:\a\_actions\rharkor\caching-for-turbo\d030e88[13](https://github.com/psychobolt/vite-storybook-boilerplate/actions/runs/9617119273/job/26528200184?pr=920#step:5:14)d3de6746943c17def1f5643b1dd1e94\dist\index.js:158515:12)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:[14](https://github.com/psychobolt/vite-storybook-boilerplate/actions/runs/9617119273/job/26528200184?pr=920#step:5:15)16:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1024:12)

Which I also found another bug,

Post job cleanup.
D:\a\_actions\rharkor\caching-for-turbo\d030e8813d3de6746943c17def1f5643b1dd1e94\post.js:[2](https://github.com/psychobolt/vite-storybook-boilerplate/actions/runs/9617119273/job/26528200184?pr=920#step:10:2)2
    if (error instanceof Error) core.setFailed(error.message)
                                ^

ReferenceError: core is not defined
    at run (D:\a\_actions\rharkor\caching-for-turbo\d0[3](https://github.com/psychobolt/vite-storybook-boilerplate/actions/runs/9617119273/job/26528200184?pr=920#step:10:3)0e8813d3de6746943c17def1f5643b1dd1e94\post.js:22:33)
    at process.processTicksAndRejections (node:internal/process/task_queues:9[5](https://github.com/psychobolt/vite-storybook-boilerplate/actions/runs/9617119273/job/26528200184?pr=920#step:10:5):5)

Node.js v20.13.1

Seeing here import * as core from '@actions/core'; is not declared.

Also would it be ideal for log folder be same as runner.temp? Reference

As a workaround for anyone running into the same issue for Windows, you may add this step:

- name: Create Turbo Cache Server Log
  if: matrix.os == 'windows-latest'
  run: mkdir D:/tmp && touch D:/tmp/turbogha.log || exit 0
  shell: bash

Failing to cache on Windows

Hi, there is a error with finding the temporary cached data on Windows. See logs:

Error: Unable to upload cache: Error: ENOENT: no such file or directory, open 'D:\tmp\cache-24932.tg.bin'
{"level":50,"time":1719255262077,"pid":3380,"hostname":"fv-az1489-381","reqId":"req-a","req":{"method":"PUT","url":"/v8/artifacts/1d9d215f8c05f1f4?slug=turbogha","hostname":"localhost:41230","remoteAddress":"::1","remotePort":50049},"res":{"statusCode":500},"err":{"type":"Error","message":"ENOENT: no such file or directory, open 'D:\\tmp\\cache-24932.tg.bin'","stack":"Error: ENOENT: no such file or directory, open 'D:\\tmp\\cache-24932.tg.bin'","errno":-[40](https://github.com/psychobolt/vite-storybook-boilerplate/actions/runs/9652918639/job/26624145421#step:10:40)58,"code":"ENOENT","syscall":"open","path":"D:\\tmp\\cache-24932.tg.bin"},"msg":"ENOENT: no such file or directory, open 'D:\\tmp\\cache-24932.tg.bin'"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.