Skip to content

Commit

Permalink
Update github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
asardaes committed Dec 5, 2021
1 parent bc7aa72 commit c9d02eb
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 101 deletions.
74 changes: 24 additions & 50 deletions .github/workflows/check-non-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,88 +22,62 @@ jobs:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
# https://community.codecov.io/t/stuck-in-processing-and-unable-to-find-report-content-in-the-storage-archive/2534
with:
fetch-depth: 10

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

- uses: r-lib/actions/setup-pandoc@v1

- uses: r-lib/actions/setup-tinytex@v1

- name: Set up tex in OSX
if: runner.os == 'macOS'
run: tlmgr install placeins cleveref

- name: 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")
shell: Rscript {0}

- name: Restore R package cache
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@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-
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- 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"))')
- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: rcmdcheck

- uses: r-lib/actions/setup-tinytex@v1

- name: Install dependencies
- name: Install Yihui packages
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
tinytex:::install_yihui_pkgs()
shell: Rscript {0}
Rscript -e 'tinytex:::install_yihui_pkgs()'
# Otherwise building the vignette on Windows fails
- name: Preinstall release version of package
if: runner.os == 'Windows'
run: |
remotes::install_cran("dtwclust")
shell: Rscript {0}
Rscript -e 'install.packages("dtwclust")'
- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(build_args = "--compact-vignettes", args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v1
continue-on-error: ${{ matrix.config.r == 'devel' }}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Test coverage
if: runner.os == 'Linux' && matrix.config.r == 'release'
run: |
Rscript -e 'remotes::install_cran("covr")'
Rscript -e 'install.packages("covr")'
Rscript codecov.R
continue-on-error: true

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: |
check
path: check
75 changes: 24 additions & 51 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,89 +21,62 @@ jobs:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
# https://community.codecov.io/t/stuck-in-processing-and-unable-to-find-report-content-in-the-storage-archive/2534
with:
fetch-depth: 10

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

- uses: r-lib/actions/setup-pandoc@v1

- uses: r-lib/actions/setup-tinytex@v1

- name: Set up tex in OSX
if: runner.os == 'macOS'
run: tlmgr install placeins cleveref

- name: 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")
shell: Rscript {0}

- name: Restore R package cache
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@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-
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- 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"))')
- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: rcmdcheck

- uses: r-lib/actions/setup-tinytex@v1

- name: Install dependencies
- name: Install Yihui packages
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
tinytex:::install_yihui_pkgs()
shell: Rscript {0}
Rscript -e 'tinytex:::install_yihui_pkgs()'
# Otherwise building the vignette on Windows fails
- name: Preinstall release version of package
if: runner.os == 'Windows'
run: |
remotes::install_cran("dtwclust")
shell: Rscript {0}
Rscript -e 'install.packages("dtwclust")'
- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(build_args = "--compact-vignettes", args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v1
continue-on-error: ${{ matrix.config.r == 'devel' }}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Test coverage
if: runner.os == 'Linux' && matrix.config.r == 'release'
run: |
Rscript -e 'remotes::install_cran("covr")'
Rscript -e 'install.packages("covr")'
Rscript codecov.R
continue-on-error: true

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: |
check
path: check

0 comments on commit c9d02eb

Please sign in to comment.