Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:StevenMMortimer/salesforcer into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenMMortimer committed Nov 5, 2024
2 parents 89ec9d3 + 9c8de66 commit 961bf20
Show file tree
Hide file tree
Showing 527 changed files with 48,764 additions and 45,988 deletions.
52 changes: 17 additions & 35 deletions .github/workflows/main-01-pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:
inputs:
trigger_next:
description: 'Whether to run the subsequent workflows after triggering this one manully.'
description: 'Whether to run the subsequent workflows after triggering this one manually.'
required: false
default: false
push:
Expand Down Expand Up @@ -46,51 +46,33 @@ jobs:
echo GITHUB_SHA = $GITHUB_SHA
echo GITHUB_REF = $GITHUB_REF
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
use-public-rspm: true

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

- name: Query dependencies
run: |
install.packages("remotes")
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v4
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-4.4-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.4-1-
extra-packages: any::pkgdown, local::.
needs: website

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_dev("pkgdown")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
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)'
- name: Deploy to GitHub pages
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs

- name: Trigger next workflow
if: ${{ (github.event_name != 'workflow_dispatch' && success()) || (github.event_name == 'workflow_dispatch' && github.event.inputs.trigger_next && success()) }}
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: StevenMMortimer/salesforcer
Expand All @@ -99,7 +81,7 @@ jobs:

- name: Set final R-CMD-check status
if: ${{ (github.event_name != 'workflow_dispatch' && failure()) }}
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: StevenMMortimer/salesforcer
Expand Down
59 changes: 32 additions & 27 deletions .github/workflows/main-02-test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
trigger_next:
description: 'Whether to run the subsequent workflows after triggering this one manully.'
description: 'Whether to run the subsequent workflows after triggering this one manually.'
required: false
default: false
repository_dispatch:
Expand All @@ -16,7 +16,7 @@ on:
jobs:
test-coverage:

runs-on: macOS-latest
runs-on: ubuntu-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -52,41 +52,46 @@ jobs:
r-version: 'release'
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage

- name: Query dependencies
- name: Test coverage
run: |
install.packages("remotes")
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v4
- uses: codecov/codecov-action@v4
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-4.4-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.4-1-
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Install dependencies
- name: Show testthat output
if: always()
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

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

- name: Test coverage
run: covr::codecov(quiet=FALSE)
shell: Rscript {0}
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package

- name: Trigger next workflow
if: ${{ (github.event_name != 'workflow_dispatch' && success()) || (github.event_name == 'workflow_dispatch' && github.event.inputs.trigger_next && success()) }}
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: StevenMMortimer/salesforcer
Expand All @@ -95,7 +100,7 @@ jobs:

- name: Set final R-CMD-check status
if: ${{ (github.event_name != 'workflow_dispatch' && failure()) }}
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: StevenMMortimer/salesforcer
Expand Down
66 changes: 10 additions & 56 deletions .github/workflows/main-03-R-CMD-check-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
trigger_next:
description: 'Whether to run the subsequent workflows after triggering this one manully.'
description: 'Whether to run the subsequent workflows after triggering this one manually.'
required: false
default: false
repository_dispatch:
Expand All @@ -22,7 +22,7 @@ jobs:
max-parallel: 1
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
Expand All @@ -46,65 +46,19 @@ jobs:
use-public-rspm: true
r-version: ${{ matrix.config.r }}

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

- name: Query dependencies
run: |
install.packages("remotes")
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v4
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-3-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-3-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("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
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

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

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v4
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r-${{ matrix.config.r }}-results
path: check
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

- name: Trigger next workflow
if: ${{ (github.event_name != 'workflow_dispatch' && success()) || (github.event_name == 'workflow_dispatch' && github.event.inputs.trigger_next && success()) }}
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: StevenMMortimer/salesforcer
Expand All @@ -113,7 +67,7 @@ jobs:

- name: Set final R-CMD-check status
if: ${{ (github.event_name != 'workflow_dispatch' && failure()) }}
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: StevenMMortimer/salesforcer
Expand Down
Loading

0 comments on commit 961bf20

Please sign in to comment.