Github action recompiling everything everytime

Hey,

i’m trying to run some Julia code on github action. I have a Project.toml and a Manifest.toml in the repo, and my main.jl file starts as:

using Pkg
Pkg.activate(".")
Pkg.instantiate(verbose = true)
using AllNeededPackages
# run code to produce graphs and stuff. 
# ...
Plots.savefig("figs/figure.pdf")
# ...

The .github/workflows/build.toml looks like :

name: Build
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo with history.
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Setup Julia
        uses: julia-actions/setup-julia@v1
        with:
          version: 1.8.5
      - name: Cache Julia 
        uses: julia-actions/cache@v1
        with:
          cache-registries: "true"
          cache-compiled: "true"
      - name: Run julia code
        run: julia --project main.jl
        env:
            GKSwstype: "100" # https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988
      - name: Other stuff using the resulting graphs...
...
...

This is working correctly however it looks like it recompiles every package at every run. Am I doing something wrong // is there a way to tell github action to cache the compiled stuff ?

Is there a ‘softer’ way to setup my environement ?

1 Like