I have two jobs in the same GitHub Actions workflow. The first one creates a file and the second one expects to find this file in the same directory where the first one created it.
I thought I can use actions/cache@v3 for it like so:
jobs:
job1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: some_dir/my_file
key: my_file
... (create the file)
job2:
needs: job1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: some_dir/my_file
key: my_file
... (use the file)
GitHub Action says that cache is restored successfully in job2, however, in job2 I can't find my_file in the directory where I expect it to be. What is the problem?