Cache (v2) not working between jobs

Hi,

I have a workflow where I want to first install npm dependencies, and after that use the installed node_modules to test and build the application in parallel.

The workflow looks like this:

name: "Build Release"

on:
  workflow_dispatch:
  push:
    branches: [ master ]

jobs:
  prepare:
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v2.3.4

      - name: Store node_modules in cache
        id: cache
        uses: actions/cache@v1
        with:
          path: node_modules
          key: node_modules-${{ hashFiles('package-lock.json') }}

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: 14.x

      - name: Install node_modules
        if: steps.cache.outputs.cache-hit != 'true'
        run: |
          npm ci


  test:
    runs-on: ubuntu-latest
    needs: [ prepare ]
    steps:
      - uses: actions/checkout@v2.3.4

      - name: Restore node_modules from cache
        uses: actions/cache@v1
        with:
          path: node_modules
          key: node_modules-${{ hashFiles('package-lock.json') }}

      - name: Run tests
        uses: GabrielBB/xvfb-action@v1.5
        with:
          run: npm run test

  build:
    needs: [ prepare ]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.4

      - name: Restore node_modules from cache
        uses: actions/cache@v1
        with:
          path: node_modules
          key: node_modules-${{ hashFiles('package-lock.json') }}

      - name: Build application
        run: |
          npm run build-prod

As long as I use actions/cache@v1, this works as intended. However, using v2 always leads to a cache miss in the test and build jobs, even if the cache exists and can be hit in the prepare job.

Did anything change in v2 with regards to how the cache works between jobs?