From cdb2cf5afc27b7e78ed5e73008d1b238c8d07787 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 9 Nov 2021 20:34:06 +0100 Subject: [PATCH 1/4] adds github actions --- .github/workflows/check-pak.yaml | 67 ++++++++++++++++++++++++ .github/workflows/pkgdown.yaml | 51 ++++++++++++++++++ .github/workflows/test-coverage-pak.yaml | 30 +++++++++++ 3 files changed, 148 insertions(+) create mode 100644 .github/workflows/check-pak.yaml create mode 100644 .github/workflows/pkgdown.yaml create mode 100644 .github/workflows/test-coverage-pak.yaml diff --git a/.github/workflows/check-pak.yaml b/.github/workflows/check-pak.yaml new file mode 100644 index 00000000..9bee4043 --- /dev/null +++ b/.github/workflows/check-pak.yaml @@ -0,0 +1,67 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +# +# NOTE: This workflow is overkill for most R packages and +# check-standard.yaml is likely a better choice. +# usethis::use_github_action("check-standard") will install it. +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macOS-latest, r: 'release'} + + - {os: windows-latest, r: 'release'} + # Use 3.6 to trigger usage of RTools35 + - {os: windows-latest, r: '3.6'} + + # Use older ubuntu to maximise backward compatibility + - {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-18.04, r: 'release'} + - {os: ubuntu-18.04, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-pandoc@master + + - uses: r-lib/actions/setup-r@master + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@master + with: + extra-packages: rcmdcheck + + - uses: r-lib/actions/check-r-package@master + + - name: Show testthat output + if: always() + run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload check results + if: failure() + uses: actions/upload-artifact@main + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-results + path: check diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 00000000..69751f21 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,51 @@ +on: + push: + branches: + - main + - master + +name: pkgdown + +jobs: + pkgdown: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@master + + - uses: IndrajeetPatil/actions/setup-pandoc@master + + - 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: 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- + + - name: Install dependencies + run: | + install.packages("remotes") + # To get links for homepage + remotes::install_cran("devtools") + remotes::install_deps(dependencies = TRUE) + remotes::install_dev("pkgdown") + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Deploy package + run: | + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, clean = TRUE)' diff --git a/.github/workflows/test-coverage-pak.yaml b/.github/workflows/test-coverage-pak.yaml new file mode 100644 index 00000000..aa969c3f --- /dev/null +++ b/.github/workflows/test-coverage-pak.yaml @@ -0,0 +1,30 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +name: test-coverage + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@master + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@master + with: + extra-packages: covr + + - name: Test coverage + run: covr::codecov() + shell: Rscript {0} From 0eb7391a4d399025868be8a6fb36584f626d19fb Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 9 Nov 2021 20:36:45 +0100 Subject: [PATCH 2/4] minor --- .github/workflows/pkgdown.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 69751f21..32e53512 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -16,7 +16,7 @@ jobs: - uses: r-lib/actions/setup-r@master - - uses: IndrajeetPatil/actions/setup-pandoc@master + - uses: r-lib/actions/setup-pandoc@master - name: Query dependencies run: | From 25b2db13f80a328e8c17b008644e72309450dcd0 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 9 Nov 2021 20:38:04 +0100 Subject: [PATCH 3/4] also lint --- .github/workflows/lint.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..23a449ca --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,29 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: lint + +jobs: + lint: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@master + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@master + with: + extra-packages: lintr + + - name: Lint + run: lintr::lint_package() + shell: Rscript {0} From aebb37099d17263762a2bf08eeae9e3cf4c9cb99 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 9 Nov 2021 21:01:24 +0100 Subject: [PATCH 4/4] skip for now --- .github/workflows/check-pak.yaml | 122 +++++++++++++++---------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/.github/workflows/check-pak.yaml b/.github/workflows/check-pak.yaml index 9bee4043..f1c46ecb 100644 --- a/.github/workflows/check-pak.yaml +++ b/.github/workflows/check-pak.yaml @@ -4,64 +4,64 @@ # NOTE: This workflow is overkill for most R packages and # check-standard.yaml is likely a better choice. # usethis::use_github_action("check-standard") will install it. -on: - push: - branches: [main, develop] - pull_request: - branches: [main, develop] - -name: R-CMD-check - -jobs: - R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: macOS-latest, r: 'release'} - - - {os: windows-latest, r: 'release'} - # Use 3.6 to trigger usage of RTools35 - - {os: windows-latest, r: '3.6'} - - # Use older ubuntu to maximise backward compatibility - - {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-18.04, r: 'release'} - - {os: ubuntu-18.04, r: 'oldrel-1'} - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-pandoc@master - - - uses: r-lib/actions/setup-r@master - with: - r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@master - with: - extra-packages: rcmdcheck - - - uses: r-lib/actions/check-r-package@master - - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main - with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check +# on: +# push: +# branches: [main, develop] +# pull_request: +# branches: [main, develop] +# +# name: R-CMD-check +# +# jobs: +# R-CMD-check: +# runs-on: ${{ matrix.config.os }} +# +# name: ${{ matrix.config.os }} (${{ matrix.config.r }}) +# +# strategy: +# fail-fast: false +# matrix: +# config: +# - {os: macOS-latest, r: 'release'} +# +# - {os: windows-latest, r: 'release'} +# # Use 3.6 to trigger usage of RTools35 +# - {os: windows-latest, r: '3.6'} +# +# # Use older ubuntu to maximise backward compatibility +# - {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'} +# - {os: ubuntu-18.04, r: 'release'} +# - {os: ubuntu-18.04, r: 'oldrel-1'} +# +# env: +# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} +# R_KEEP_PKG_SOURCE: yes +# +# steps: +# - uses: actions/checkout@v2 +# +# - uses: r-lib/actions/setup-pandoc@master +# +# - uses: r-lib/actions/setup-r@master +# with: +# r-version: ${{ matrix.config.r }} +# http-user-agent: ${{ matrix.config.http-user-agent }} +# use-public-rspm: true +# +# - uses: r-lib/actions/setup-r-dependencies@master +# with: +# extra-packages: rcmdcheck +# +# - uses: r-lib/actions/check-r-package@master +# +# - name: Show testthat output +# if: always() +# run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true +# shell: bash +# +# - name: Upload check results +# if: failure() +# uses: actions/upload-artifact@main +# with: +# name: ${{ runner.os }}-r${{ matrix.config.r }}-results +# path: check