Skip to content

Commit

Permalink
CI: Configure ccache for speeding up grass, addons, and R packages by…
Browse files Browse the repository at this point in the history
… up to 3.5min (#1310)

* CI: Add ccache to ci workflow

CI: expire files in cache after 7 days

* CI: Add cache key to ccache

* CI: Pin ccache action

* CI: Set Ncpus: 4 to R setup action

CI: Show R Ncpus option used

* CI: Increase verbose level of ccache

* CI: configure ccache for R package builds
  • Loading branch information
echoix authored Feb 11, 2025
1 parent 959fabd commit 1f3de84
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: grass-addons
- name: ccache
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
with:
create-symlink: true
verbose: 2
evict-old-files: 7d
key: ${{ github.job }}-${{ matrix.grass-version }}-${{ matrix.python-version }}

- name: Get dependencies
run: |
Expand Down Expand Up @@ -110,7 +117,13 @@ jobs:
uses: r-lib/actions/setup-r@473c68190595b311a74f208fba61a8d8c0d4c247 # v2.11.1
with:
r-version: 4.2.1

Ncpus: 4
- name: Configure ccache for R package builds
run: |
# R package sources are extracted as newly created files
echo "CCACHE_SLOPPINESS=include_file_ctime" >> "${GITHUB_ENV}"
# R temp directory name differs
echo "CCACHE_NOHASHDIR=true" >> "${GITHUB_ENV}"
- name: Get R dependencies
run: |
grass-addons/.github/workflows/install_r_packages.R
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/install_r_packages.R
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env Rscript
getOption("Ncpus", 1L)
install.packages(c("MuMIn", "lme4", "optparse", "snow"))

0 comments on commit 1f3de84

Please sign in to comment.