diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 3d893a092..451bc2a7a 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -29,17 +29,16 @@ jobs: - {os: macOS-latest, r: 'release'} - {os: windows-latest, r: 'release'} - {os: windows-latest, r: '3.6'} - - {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} + - {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" } + - {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - {os: ubuntu-18.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - {os: ubuntu-18.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - {os: ubuntu-18.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - - {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true RSPM: ${{ matrix.config.rspm }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -57,19 +56,22 @@ jobs: - name: Install pak and query dependencies run: | install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") - saveRDS(pak::pkg_deps_tree("local::.", dependencies = TRUE), ".github/r-depends.rds") + saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") shell: Rscript {0} - name: Cache R packages uses: actions/cache@v2 with: path: ${{ env.R_LIBS_USER }} - key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-2-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-2- + key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} + restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- - - name: Install linux system dependencies + - name: Install system dependencies if: runner.os == 'Linux' - run: Rscript -e 'pak::local_system_requirements(execute = TRUE)' + run: | + pak::local_system_requirements(execute = TRUE) + pak::pkg_system_requirements("rcmdcheck", execute = TRUE) + shell: Rscript {0} - name: Install macOS system dependencies if: runner.os == 'macOS' @@ -99,7 +101,9 @@ jobs: env: _R_CHECK_CRAN_INCOMING_: false _R_CHECK_FORCE_SUGGESTS_: ${{ matrix.config.r != '3.3' }} - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") + run: | + options(crayon.enabled = TRUE) + rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") shell: Rscript {0} - name: Show testthat output diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index e05773156..d64002431 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -8,46 +8,49 @@ name: pkgdown jobs: pkgdown: - runs-on: macOS-latest + runs-on: ubuntu-18.04 env: + RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: - uses: actions/checkout@v2 - uses: r-lib/actions/setup-r@v1 + id: install-r - uses: r-lib/actions/setup-pandoc@v1 - - name: Query dependencies + - name: Install pak and query dependencies run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") + saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") shell: Rscript {0} - name: Cache R packages uses: actions/cache@v2 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- + key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} + restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1- - - name: Install macOS system dependencies - if: runner.os == 'macOS' + - name: Install system dependencies + if: runner.os == 'Linux' run: | - brew install libgit2 - brew install imagemagick@6 + pak::local_system_requirements(execute = TRUE) + pak::pkg_system_requirements("pkgdown", execute = TRUE) + shell: Rscript {0} - name: Install dependencies run: | - remotes::install_deps(dependencies = TRUE) - install.packages("pkgdown", type = "binary") + pak::local_install_dev_deps(upgrade = TRUE) + pak::pkg_install("pkgdown") shell: Rscript {0} - name: Install package run: R CMD INSTALL . - - name: Deploy package + - name: Build and deploy pkgdown site run: | git config --local user.name "$GITHUB_ACTOR" git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 9f55fb2a8..ebdbb4e6d 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -12,40 +12,41 @@ name: test-coverage jobs: test-coverage: - runs-on: macOS-latest + runs-on: ubuntu-18.04 env: + RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: - uses: actions/checkout@v2 - uses: r-lib/actions/setup-r@v1 + id: install-r - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies + - name: Install pak and query dependencies run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") + saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") shell: Rscript {0} - name: Cache R packages uses: actions/cache@v2 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- + key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} + restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1- - - name: Install macOS system dependencies - if: runner.os == 'macOS' + - name: Install system dependencies + if: runner.os == 'Linux' run: | - brew install libgit2 - brew install imagemagick@6 + pak::local_system_requirements(execute = TRUE) + pak::pkg_system_requirements("covr", execute = TRUE) + shell: Rscript {0} - name: Install dependencies run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("covr") + pak::local_install_dev_deps(upgrade = TRUE) + pak::pkg_install("covr") shell: Rscript {0} - name: Configure Git user diff --git a/R/github-actions.R b/R/github-actions.R index 598018cf8..fd7fe762e 100644 --- a/R/github-actions.R +++ b/R/github-actions.R @@ -87,8 +87,8 @@ use_tidy_github_actions <- function() { full_status <- use_github_action_check_full(repo_spec = repo_spec) pr_status <- use_github_action_pr_commands() - pkgdown_status <- use_github_action("pkgdown") - test_coverage_status <- use_github_action("test-coverage") + pkgdown_status <- use_github_action("pkgdown-pak", save_as = "pkgdown.yaml") + test_coverage_status <- use_github_action("test-coverage-pak", save_as = "test-coverage.yaml") old_configs <- proj_path(c(".travis.yml", "appveyor.yml")) has_appveyor_travis <- file_exists(old_configs) @@ -222,7 +222,7 @@ use_github_action_check_full <- function(save_as = "R-CMD-check.yaml", # this must have `repo_spec` as an argument because it is called as part of # use_tidy_github_actions() use_github_action( - "check-full.yaml", + "check-pak.yaml", save_as = save_as, ignore = ignore, open = open