Skip to content

Commit

Permalink
update yml workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
realxinzhao committed Nov 7, 2023
1 parent fce81ec commit 2e3d4be
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 22 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,42 @@ permissions:

jobs:
build:
runs-on: macos-latest
runs-on: ubuntu-latest
strategy:
matrix:
r-version: ['4.1.0']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@f57f1301a053485946083d7a45022b278929a78a
uses: r-lib/actions/setup-r@v2-branch
with:
r-version: ${{ matrix.r-version }}
- uses: r-lib/actions/setup-pandoc@v2-branch
- uses: r-lib/actions/setup-tinytex@v2-branch

- name: Cache R packages
uses: actions/cache@v1
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 including Pandoc
run: |
sudo apt-get update -q
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev libmagick++-dev libavfilter-dev
sudo apt-get install -y pandoc
shell: bash

- name: Install dependencies
run: |
install.packages(c("remotes", "rcmdcheck"))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
R -e "install.packages(c('remotes', 'rcmdcheck'), repos = 'https://cloud.r-project.org')"
R -e "remotes::install_deps(dependencies = TRUE)"
shell: bash

- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
shell: Rscript {0}
run: |
R -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'error')"
shell: bash
34 changes: 20 additions & 14 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,26 @@ jobs:
GITHUB_PAT: ${{ secrets.GH_PAT}}

steps:
- uses: actions/checkout@v1
- uses: r-lib/actions/setup-r@v2-branch
- name: Checkout code
uses: actions/checkout@v2

- name: Set up R
uses: r-lib/actions/setup-r@v1
with:
r-version: '3.6'
- uses: r-lib/actions/setup-pandoc@v2-branch
- uses: r-lib/actions/setup-tinytex@v2-branch
r-version: '4.1' # Specify your R version

- name: Set up pandoc
uses: r-lib/actions/setup-pandoc@v1

- name: Set up TinyTeX
uses: yihui/tinytex-action@v3

- name: Cache R packages
uses: actions/cache@v1
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: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}
restore-keys: ${{ runner.os }}-

- name: Ubuntu config
run: |
Expand All @@ -42,6 +49,5 @@ jobs:

- name: Test coverage
run: |
remotes::install_cran("covr")
covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")
shell: Rscript {0}
Rscript -e "remotes::install_cran('covr')"
Rscript -e "covr::codecov(token = Sys.getenv('CODECOV_TOKEN'))"

0 comments on commit 2e3d4be

Please sign in to comment.