felixmosh / turborepo-gh-artifacts

A TurboRepo local cache server which uploads artifact cache to GH artifacts.
MIT License
122 stars 7 forks source link

How would this action work in a multi-job setup? #7

Closed alexbjorlig closed 2 years ago

felixmosh commented 2 years ago

Hi, thank you for opening this issue. Can you elaborate what do you mean by "multi-job setup"? Can you add a small config example?

felixmosh commented 2 years ago

Ping

felixmosh commented 2 years ago

ping?

alexbjorlig commented 2 years ago

I'm so sorry for not getting back to you - super busy with making Turborepo working on Github actions 😅 The example in the README.md shows an example with the artifacts running in the same github action job. My question was related to how this would look like, if the github actions contained multiple jobs - maybe even a matrix in some of the jobs.

But in the end we disabled remote artifacts with turborepo, and created an initial build step.

      - name: Turbo Cache
        id: turbo-cache
        uses: actions/cache@v3
        with:
          path: .turbo
          key: turbo-${{ github.ref_name }}-${{ github.sha }}
felixmosh commented 2 years ago

I'm not sure on how Github action with matrix works, but I guess that it opens a new runner, therefore, it won't share the same instance of local server. You can use this action in parts, so one step will "upload", the other will "use".

If I didn't understood your question properly, can you share a minimal Github Action config yaml that you want to run?

alexbjorlig commented 2 years ago

So my primary objective was to make sure that when I run a build step in multiple jobs, the turborepo cache will be used. And with the cache-step outlined above I achived that 😎 So I will just close the issue if it's ok with you :)