这是indexloc提供的服务,不要输入任何密码
Skip to content

[turborepo] Remote caching does not work on workflow_call event in github actions #2967

@marcofugaro

Description

@marcofugaro

What version of Turborepo are you using?

1.6.3

What package manager are you using / does the bug impact?

Yarn v2/v3 (node_modules linker only)

What operating system are you using?

Mac

Describe the Bug

When enabling remote caching on github actions as explained in the official guide, the remote caching is disabled when using the workflow_call event.

image

The workflow_call event, is used if you want to concatenate workflows, like this for example.

image

It is better explained in the reusing workflows section of the github actions guide.

Expected Behavior

Remote caching should work in workflow_call events.

To Reproduce

# .github/workflows/build.yml

name: Build

on:
  workflow_call:

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      TURBO_TOKEN: ${{ secrets. TURBO_TOKEN }}
      TURBO_TEAM: ${{ secrets. TURBO_TEAM }}

    steps:
      - name: Check out code
        uses: actions/checkout@v3

      - name: Use latest node
        uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: 'yarn'

      - name: Install dependencies
        run: yarn install --immutable

      # remote caching does not work here... but it should
      - name: Build
        run: yarn build

      - name: Upload artifact
        uses: actions/upload-artifact@v3
        with:
          name: my-app
          path: ./apps/my-app/dist/
# .github/workflows/deploy.yml

name: Deploy 

on:
  push:
    branches:
      - main

jobs:
  build:
    uses: ./.github/workflows/build.yml

  deploy:
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Download artifact
        uses: actions/download-artifact@v3
        with:
          name: my-app
          path: ./

      - name: Display downloaded files
        run: ls -R ./

      - name: Deploy 
        # ...

Reproduction Repo

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions