r-lib / actions

GitHub Actions for the R community
Creative Commons Zero v1.0 Universal
964 stars 210 forks source link

Cache not saving despite successful dependency step #914

Open aschmidt-amplify opened 1 month ago

aschmidt-amplify commented 1 month ago

STOP

If you are debugging a failed build or have a question about GitHub Actions in general do NOT open an issue here. Either post on the Actions sections of the GitHub Community or the RStudio Community forums.

Open an issue here only if you have a bug in one of the custom R specific actions themselves.

Describe the bug When a workflow runs, I do not see a stored cache, even if the workflow is successful. In the logs, I see:

Cache not found for input keys: Windows Server 2022 x64 (build 20348)-R version 4.4.1 (2024-06-14 ucrt)-1-0aab29eb803e797a0ac7c390c4d654267026b8bed8c76d5d72559ffed7c1e929, Windows Server 2022 x64 (build 20348)-R version 4.4.1 (2024-06-14 ucrt)-1-

Note: I see this for macos and ubuntu, too

To Reproduce You MUST include a link to the full logs of the failed build. Bug reports which do not contain a link, or only contain a screenshot of the failed build will be closed.

Link to logs

Workflow:

on:
  pull_request:
    branches: [main]
    paths:
      - '.github/workflows/test_package.yml'
      - 'tests/testthat/*'
      - 'R/*'

name: R-CMD-check

permissions: read-all

jobs:
  R-CMD-check:
    runs-on: ${{ matrix.config.os }}

    name: ${{ matrix.config.os }} (${{ matrix.config.r }})

    strategy:
      fail-fast: false
      matrix:
        config:
          - {os: macos-latest,   r: 'release'}
          - {os: windows-latest, r: 'release'}
          - {os: ubuntu-latest,   r: 'release'}

    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
      R_KEEP_PKG_SOURCE: yes

    steps:
      - uses: actions/checkout@v4

      - uses: r-lib/actions/setup-r@v2
        with:
          r-version: ${{ matrix.config.r }}
          http-user-agent: ${{ matrix.config.http-user-agent }}
          use-public-rspm: true

      - uses: r-lib/actions/setup-r-dependencies@v2
        with:
          extra-packages: any::rcmdcheck
          needs: check

      - uses: r-lib/actions/check-r-package@v2
        with:
          upload-snapshots: true
          build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

Expected behavior Dependencies are cached

Additional context Here is the specific message that setup-r-dependencies emits in the logs re: cache v4:

with:
    path: D:\a\_temp\Library/*
  renv/library
  !D:\a\_temp\Library/pak
  !D:\a\_temp\Library/_cache

    key: Windows Server 2022 x64 (build 20348)-R version 4.4.1 (2024-06-14 ucrt)-1-0aab29eb803e797a0ac7c390c4d654267026b8bed8c76d5d72559ffed7c1e929
    restore-keys: Windows Server 2022 x64 (build 20348)-R version 4.4.1 (2024-06-14 ucrt)-1-
    save-always: false
    enableCrossOsArchive: false
    fail-on-cache-miss: false
    lookup-only: false
  env:
    GITHUB_PAT: ***
    R_KEEP_PKG_SOURCE: yes
    _R_INSTALL_TIME_PATCHES_: no
    R_LIBS_USER: D:\a\_temp\Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
    RSPM: https://packagemanager.posit.co/cran/latest
    RENV_CONFIG_REPOS_OVERRIDE: https://packagemanager.posit.co/cran/latest
    R_LIB_FOR_PAK: C:/R/site-library
gaborcsardi commented 1 month ago

I cannot see your logs.