From b2df3edd961a222bd0c169ad9d5b3c0e627f9bb5 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Wed, 9 Jun 2021 15:37:45 +0200 Subject: [PATCH 1/2] update gh actions --- .github/workflows/R-CMD-check.yaml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 8fab229d4..7814fb6e4 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -8,9 +8,11 @@ on: push: branches: - master + - main pull_request: branches: - master + - main name: R-CMD-check @@ -34,11 +36,6 @@ jobs: # Linux - {os: ubuntu-18.04, r: 'release', installation_method: 'pip', 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-18.04, r: 'release', installation_method: 'conda', 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: 'devel', installation_method: 'conda', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest", http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" } -# - {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} -# - {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} -# - {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} -# - {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true @@ -49,12 +46,12 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v1 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} - - uses: r-lib/actions/setup-pandoc@master + - uses: r-lib/actions/setup-pandoc@v1 - name: Query dependencies run: | @@ -63,20 +60,20 @@ jobs: 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 + - name: Restore R package cache + 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- + - name: Install system dependencies (Linux) if: runner.os == 'Linux' run: | while read -r cmd do eval sudo $cmd - done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "18.04"), sep = "\n")') + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "18.04"))') - name: Install system dependencies (brew) if: matrix.config.installation_method == 'brew' @@ -111,6 +108,7 @@ jobs: env: _R_CHECK_CRAN_INCOMING_: false run: | + options(crayon.enabled = TRUE) if (Sys.getenv("PRECOMMIT_INSTALLATION_METHOD") != 'conda') { Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "False") } @@ -129,3 +127,8 @@ jobs: with: name: ${{ runner.os }}-r${{ matrix.config.r }}-results path: check + + - name: Don't use tar from old Rtools to store the cache + if: ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3.6' ) }} + shell: bash + run: echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH From d505b05c05531401bbdb0c112b15711b54f88b99 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Wed, 9 Jun 2021 16:30:59 +0200 Subject: [PATCH 2/2] add news --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index b1ed758da..e780d2610 100644 --- a/NEWS.md +++ b/NEWS.md @@ -59,6 +59,7 @@ depending on whether or not you previously used pre-commit. `--allow_private_imports` when the hook fails due to private imports (#254). - roxygenize hook is now fully tested (#267). - Hook scripts were relocated and R hooks now have a file extension (#280). +- Updated GitHub Action workflows (#288). # precommit v0.1.3