Skip to content

cache checks #83

@dbarrosop

Description

@dbarrosop

Hello,
is it possible to cache checks? I am attempting to move from using my own s3 cache to this to simplify a bit the setup but I am having an issue because the result of running the checks doesn't seem to be cached. Because some of my tests requires a bit of infrastructure I was doing something like the following:

    - name: "Verify if we need to build"
      id: verify-build
      run: |
        export check_dry_run_output=$(nix build \
                --dry-run \
                --json \
                --print-build-logs \
                .\#checks.$(ARCH)-$(OS).$(NAME))
        export drvPath=$(echo "$check_dry_run_output" | grep -oE '"out":.*"' | awk -F\" '{ print $4 }')
        nix store verify --no-trust --store s3://..... $drvPath \
          && export BUILD_NEEDED=no \
          || export BUILD_NEEDED=yes
        echo BUILD_NEEDED=$BUILD_NEEDED >> $GITHUB_OUTPUT

Then in the rest of the workflow I can just use BUILD_NEEDED to skip unnecessary tests.

However, this doesn't seem to work after moving to use this store instead of s3, I suspect because the check derivation isn't being cached.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions