Update README.md #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: R-CMD-check-test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
R-CMD-check-ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3.6.0 | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev | |
sudo apt-get install -y texlive texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texinfo ghostscript | |
- name: Determine Cache Key | |
id: cache-key | |
run: | | |
echo "CACHE_KEY=renv-$(date +%Y-%m)" >> $GITHUB_ENV | |
- name: Print Cache Key | |
run: | | |
echo "Cache key is: ${{ env.CACHE_KEY }}" | |
- name: Cache R packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/R | |
key: ${{ env.CACHE_KEY }} | |
restore-keys: | | |
${{ runner.os }}-renv- | |
- name: Install R packages | |
run: | | |
Rscript -e ' | |
packages <- c("devtools", "remotes", "terra", "sf", "rgbif", "CoordinateCleaner", "ClusterR", "FNN", "geometry", "cluster", "rnaturalearth", "mclust", "methods", "utils", "zip") | |
installed <- rownames(installed.packages()) | |
missing <- setdiff(packages, installed) | |
if (length(missing) > 0) { | |
install.packages(missing, repos = "https://cloud.r-project.org") | |
} | |
' | |
- name: Check package | |
run: | | |
R CMD build . | |
R CMD check *.tar.gz | |
- name: Upload check results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: R-CMD-check-results | |
path: gbif.range.Rcheck |