awalsh128 / cache-apt-pkgs-action

Cache APT packages in GitHub Actions
Other
205 stars 35 forks source link

Can be used with matrix strategy? #38

Closed td43 closed 2 years ago

td43 commented 2 years ago

Hi,

I have setup my workflow where I have

strategy:
      matrix:
        version: ['${{ toJSON(github.ref) }}', latest]
    steps:
      - name: Clone Repository
        uses: actions/checkout@v3
        with:
          submodules: recursive

      - name: Install PCL
        uses: awalsh128/cache-apt-pkgs-action@v1
        with:
          packages: libpcl-dev
          version: 1.0

and I want to cache the libpcl-dev for both jobs, but it seems that one is canceling the other:

dd

dd2

td43 commented 2 years ago

I found out I don't need to use matrix for my project.

awalsh128 commented 2 years ago

Hi @danielTobon43, even though you aren't using it, this may be a use case causing a bug in this action. What leads you to believe they were cancelling each other out?

td43 commented 2 years ago

Hi @danielTobon43, even though you aren't using it, this may be a use case causing a bug in this action. What leads you to believe they were cancelling each other out?

My guess is that the jobs are using the same "cache" space. I read that GitHub only allows 5GB for caching, so even though a workspace of a job is independent of another, the cache space doesn't. When a job is writing to cache and then another one is trying to do the same is like the first one is being canceled because the operation is being triggered for another job.

Or I might be wrong, to be honest, I don't fully understand the functionality of GitHub actions to that deeper level.

Check this: Restrictions for accessing a cache