Skip to content

Commit

Permalink
Update with-auth.yaml (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle authored Mar 22, 2021
1 parent c9c5843 commit fb84cec
Showing 1 changed file with 23 additions and 34 deletions.
57 changes: 23 additions & 34 deletions .github/workflows/with-auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,55 @@ on:
schedule:
- cron: '0 12 * * *'

name: R-CMD-check
name: with-auth

jobs:
R-CMD-check:
with-auth:
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", vcrturnoff: 'true', auth: MEETUPR_PWD}
runs-on: macOS-latest

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
VCR_TURN_OFF: ${{ matrix.config.vcrturnoff }}
MEETUPR_PWD: ${{ secrets[matrix.config.auth] }}
VCR_TURN_OFF: true
MEETUPR_PWD: ${{ secrets.MEETUPR_PWD }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
id: install-r
with:
r-version: ${{ matrix.config.r }}
r-version: release

- 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
if: runner.os != 'Windows'
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
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
key: mac-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: mac-${{ steps.install-r.outputs.installed-r-version }}-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
pak::local_install_dev_deps(upgrade = TRUE)
pak::pkg_install("rcmdcheck")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
Expand Down

0 comments on commit fb84cec

Please sign in to comment.