diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 79c29b1..6d369a1 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -36,31 +36,31 @@ jobs: steps: - - name: Set R Library home on Linux - if: runner.os == 'Linux' - run: | - mkdir /__w/_temp/Library - echo ".libPaths('/__w/_temp/Library')" > ~/.Rprofile - - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup R from r-lib - if: runner.os != 'Linux' uses: r-lib/actions/setup-r@v2 with: + use-public-rspm: true r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} - name: Setup pandoc from r-lib - if: runner.os != 'Linux' uses: r-lib/actions/setup-pandoc@v2 - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - shell: Rscript {0} + - name: Query dependencies from r-lib + uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - name: Query dependencies from r-lib (Linux) + if: runner.os == 'Linux' && runner.r == '4.3' + uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, any::covr, local::. + needs: website, coverage - name: Restore R package cache if: "!contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'" @@ -78,22 +78,6 @@ jobs: key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }} restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-${{ matrix.config.r }}- - - name: Install system dependencies - if: runner.os == 'ubuntu-22.04' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: | - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" - - - name: Install R dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - remotes::install_cran("pkgdown") - remotes::install_cran("covr") - shell: Rscript {0} - - name: Session info run: | options(width = 100) @@ -101,40 +85,45 @@ jobs: sessioninfo::session_info(pkgs, include_base = TRUE) shell: Rscript {0} - - name: Run CMD check - env: - _R_CHECK_CRAN_INCOMING_: false - DISPLAY: 99.0 - run: | - options(crayon.enabled = TRUE) - rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Reveal testthat details - if: env.has_testthat == 'true' - run: find . -name testthat.Rout -exec cat '{}' ';' + - name: Run CMD check from r-lib + uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' - name: Test coverage - if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'ubuntu-22.04' + if: github.ref == 'refs/heads/master' && runner.os == 'Linux' && runner.r == '4.3' run: | - covr::codecov(coverage = covr::package_coverage(type = "all")) + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) shell: Rscript {0} + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + - name: Upload check results if: failure() - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check - - - name: Install package - if: github.ref == 'refs/heads/master' && runner.os == 'ubuntu-22.04' && runner.r == '4.3' - run: | - R CMD INSTALL . - git config --global user.name ${{secrets.GH_USER}} - git config --global user.email ${{secrets.GH_EMAIL}} + name: coverage-test-failures + path: ${{ runner.temp }}/package - - name: Deploy Pkgdown to branch - if: github.ref == 'refs/heads/master' && runner.os == 'ubuntu-22.04' && runner.r == '4.3' - run: pkgdown::deploy_to_branch(new_process = FALSE) + - name: Build with Pkgdown + if: github.ref == 'refs/heads/master' && runner.os == 'Linux' && runner.r == '4.3' + run: pkgdown::deploy_to_branch(new_process = FALSE, install = FALSE) shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.ref == 'refs/heads/master' && runner.os == 'Linux' && runner.r == '4.3' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs