Quantcast
Channel: Clear cache in GitHub Actions - Stack Overflow
Viewing all articles
Browse latest Browse all 12

Clear cache in GitHub Actions

$
0
0

I am working on an R package and using GitHub Action (GHA) as a Continuous Integration (CI) provider. I cache R packages (dependencies) by using actions/cache. And now I want to clear all cache. How can I do that?


A part of GHA Workflow I use:
on: pushname: R-CMD-checkjobs:  R-CMD-check:    runs-on: ${{ matrix.config.os }}    name: ${{ matrix.config.os }} (${{ matrix.config.r }})    strategy:      fail-fast: false      matrix:        config:          # - {os: windows-latest, r: 'devel'}          - {os: macOS-latest,   r: 'release'}    env:      R_REMOTES_NO_ERRORS_FROM_WARNINGS: true      RSPM: ${{ matrix.config.rspm }}      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}    steps:      - uses: actions/checkout@v2      - uses: r-lib/actions/setup-r@master      - name: Query dependencies        run: |          repos <- c("https://r-hyperspec.github.io/hySpc.pkgs/", getOption("repos"))          saveRDS("remotes::dev_package_deps(dependencies = TRUE)", ".github/depends.Rds", version = 2)          writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")        shell: Rscript {0}      - name: Cache R packages        if: runner.os != 'Windows'        uses: actions/cache@v1        with:          path: ${{ env.R_LIBS_USER }}          key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}          restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-      - name: Install dependencies        run:   remotes::install_deps(dependencies = TRUE)        shell: Rscript {0}      - name: Session info        run: |          options(width = 100)          pkgs <- installed.packages()[, "Package"]          sessioninfo::session_info(pkgs, include_base = TRUE)        shell: Rscript {0}

Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>