cache doesn't work with github workspace directory

Hi, I'm trying to cache the whole workspace to fetch it between jobs.
Unfortunately it seems like the local directory can not be cached

Using . doesn't work (it cache 22B)

- name: Cache build folder
        uses: actions/cache@v3
        with:
          key: cs-repo-${{ github.run_number }}-${{ github.run_attempt }}
          path: .

Using ${{ github.workspace }} doesn't work (it also cache 22B)

- name: Cache build folder
        uses: actions/cache@v3
        with:
          key: cs-repo-${{ github.run_number }}-${{ github.run_attempt }}
          path: ${{ github.workspace }}

the only solution I found which work is to list all the files/directory

- name: Cache build folder
        uses: actions/cache@v3
        with:
          key: cs-repo-${{ github.run_number }}-${{ github.run_attempt }}
          path: |
              file1
              file2
              dir1
              dir2