改善
Kaizen  · Today I Learned by Ville Säävuori

Weeknotes 2022/19 - Working on GitHub

I’ve been starting to migrate away from GitLab as they hiked their prices 400% and that just didn’t sit right with me. It kind of pains me to part from GitLab as I really love the product and I’m always happy to root for the underdog but their attitude towards their customers has just been super bad and I just don’t want to condone that kind of behavior.

Fighting With GitHub Actions Stale Cache

One thing where GitLab is still miles ahead of GitHub is the CI tooling. GitLab CI is an awesome product and it’s much more mature than GH Actions. One thing I keep bumping in my personal projects is that a workflows with cached jobs get stale when they are not worked on actively and then they just break — and there’s seemingly nothing you can do about it (via the UI).

For example, I have plenty of actions that have a cache part like this:

- uses: actions/cache@v3
  with:
    path: /home/runner/.local/share/pnpm/store
    key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
    restore-keys: |
      ${{ runner.os }}-

Which, after 7-15 days of inactivity just start breaking in random ways, like here:

ENOENT  ENOENT: no such file or directory, copyfile '/home/runner/.local/share/pnpm/store/v3/files/e1/2fa5493b6dd910775964f7cc602383aa0651fe92e2efb72cbf31a81efa35acfe15c1efb1dbc484bfa0c9321c6300ca4a2cd2f64fc8c107bfb142481c074575-exec' -> '/home/runner/.local/share/pnpm/global/5/.pnpm/protobufjs@6.11.3/node_modules/_tmp_1918_1423e8387b7be3742a5eb30c6ac2053a/bin/pbjs'

Just commenting out the cache part of the workflow works but then you are merging a commented out workflow file which you need to uncomment by pushing to the master. What a PITA.