title: Caching APT packages in GitHub Actions workflow
body: <p>I use the following Github Actions workflow for my C project. The workflow finishes in ~40 seconds, but more than half of that time is spent by installing the <code>valgrind</code> package and its dependencies.</p>
  
  <p>I believe caching could help me speed up the workflow. I do not mind waiting a couple of extra seconds, but this just seems like a pointless waste of GitHub's resources.</p>
  
  <pre><code>name: C Workflow
  
  on: [push, pull_request]
  
  jobs:
    build:
      runs-on: ubuntu-latest
  
      steps:
      - uses: actions/checkout@v1
  
      - name: make
        run: make
  
      - name: valgrind
        run: |
          sudo apt-get install -y valgrind
          valgrind -v --leak-check=full --show-leak-kinds=all ./bin
  </code></pre>
  
  <p>Running <code>sudo apt-get install -y valgrind</code> installs the following packages:</p>
  
  <ul>
  <li><code>gdb</code></li>
  <li><code>gdbserver</code></li>
  <li><code>libbabeltrace1</code></li>
  <li><code>libc6-dbg</code></li>
  <li><code>libipt1</code></li>
  <li><code>valgrind</code></li>
  </ul>
  
  <p>I know Actions support caching of a specific directory (and there are already several answered SO questions and articles about this), but I am not sure where all the different packages installed by apt end up. I assume <code>/bin/</code> or <code>/usr/bin/</code> are not the only directories affected by installing packages.</p>
  
  <p><strong>Is there an elegant way to cache the installed system packages for future workflow runs?</strong></p>