简体   繁体   中英

Github Action failing with R CMD check, using old commit?

I'm not sure how best to describe this, hence the rather vague title.

I have an R package that uses Github Actions to run checks. You can see the workflow file here:

https://github.com/Azure/Microsoft365R/blob/master/.github/workflows/check-standard.yaml

It's basically the same as the check-standard workflow in the r-lib/actions repo, with some tweaks for my particular requirements. My latest commit is failing the check for the MacOS build, with this error:

Run remotes::install_deps(dependencies = TRUE)
Error: Error: HTTP error 404.
  Not Found

  Did you spell the repo owner (`hongooi73`) and repo name (`AzureGraph`) correctly?
  - If spelling is correct, check that you have the required permissions to access the repo.
Execution halted
Error: Process completed with exit code 1.

The step in question is this. It just scans the package's DESCRIPTION file and installs the dependencies for the package -- all very straightforward.

      - name: Install dependencies
        run: |
          remotes::install_deps(dependencies = TRUE)
          remotes::install_cran(c("pkgbuild", "rcmdcheck", "drat"))
        shell: Rscript {0}

It looks like it's trying to install a dependency from the hongooi73/AzureGraph repo, which no longer exists. But my DESCRIPTION file doesn't list hongooi73/AzureGraph as a remote dependency; it uses Azure/AzureGraph of which hongooi73/AzureGraph was a fork. It used to refer to hongooi73/AzureGraph, but that was several commits ago. Indeed, the Linux and Windows checks both run without problems so they are clearly using the correct repo location.

What can be causing this failure? And how do I fix it? I've already tried rerunning the workflow, and deleting older workflows.

You're using actions/cache to cache your R libs. By this you're restoring a cache that might be invalid if your key and the restore-keys isn't set up properly.

At the moment, there is no direct way to manually clear the cache. For some other options you can check Clear cache in GitHub Actions .

Jan. 2021:

At the moment, there is no direct way to manually clear the cache

June 2022: Actually, there now is:

List and delete caches in your Actions workflows

You can now get more transparency and control over dependency caching in your actions workflows.

Actions users who use actions/cache to make jobs faster on GitHub Actions can now use ourcache list and delete APIs to:

  • list all the Actions caches within a repository and sort by specific metadata like cache size, creation time or last accessed time.
  • delete a corrupt or a stale cache entry by providing the cache key or ID.

Learn more about Managing caching dependencies to speed up workflows .

See the updated answer to "Clear cache in GitHub Actions" from beatngu13 for the GitHub API call examples.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM