Skip to content

Commit

Permalink
Merge pull request #133 from StevenMMortimer/dev
Browse files Browse the repository at this point in the history
[Release v1.0.2] Merge dev into main
  • Loading branch information
StevenMMortimer authored Nov 4, 2024
2 parents e656f88 + ef35272 commit 50ff1c0
Show file tree
Hide file tree
Showing 214 changed files with 19,815 additions and 2,364 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/dev-01-R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ on:
pull_request:
branches:
- dev

jobs:
dev-R-CMD-check:

runs-on: macOS-latest

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
SALESFORCER_USERNAME: ${{ secrets.SALESFORCER_USERNAME }}
SALESFORCER_TOKEN_PATH: ${{ github.workspace }}/tests/testthat/

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Decrypt OAuth Token
run: |
./.github/scripts/decrypt_secret.sh
env:
SALESFORCER_TOKEN_PASSPHRASE: ${{ secrets.SALESFORCER_TOKEN_PASSPHRASE }}

- name: Reveal env vars
run: |
echo GITHUB_WORKFLOW = $GITHUB_WORKFLOW
Expand All @@ -40,26 +40,27 @@ jobs:
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
echo GITHUB_SHA = $GITHUB_SHA
echo GITHUB_REF = $GITHUB_REF
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'

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

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@v1
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-4.0-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.0-2-
key: macOS-r-4.4-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.4-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
Expand All @@ -75,7 +76,7 @@ jobs:

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

Expand All @@ -86,7 +87,7 @@ jobs:

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: macOS-latest-r-release-results
path: check
51 changes: 28 additions & 23 deletions .github/workflows/main-01-pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Build pkgdown site

permissions: read-all

on:
workflow_dispatch:
inputs:
Expand All @@ -9,25 +11,27 @@ on:
default: false
push:
branches: main

jobs:
pkgdown:

runs-on: macOS-latest

# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
SALESFORCER_USERNAME: ${{ secrets.SALESFORCER_USERNAME }}
SALESFORCER_TOKEN_PATH: ${{ github.workspace }}/tests/testthat/

permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Decrypt OAuth Token
run: |
./.github/scripts/decrypt_secret.sh
env:
SALESFORCER_TOKEN_PASSPHRASE: ${{ secrets.SALESFORCER_TOKEN_PASSPHRASE }}

- name: Reveal env vars
run: |
echo GITHUB_WORKFLOW = $GITHUB_WORKFLOW
Expand All @@ -40,49 +44,50 @@ jobs:
echo GITHUB_EVENT_PATH = $GITHUB_EVENT_PATH
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
echo GITHUB_SHA = $GITHUB_SHA
echo GITHUB_REF = $GITHUB_REF
- uses: r-lib/actions/setup-r@v1
echo GITHUB_REF = $GITHUB_REF
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'

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

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@v1
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-4.0-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.0-2-
key: macOS-r-4.4-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.4-1-

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

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- 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
Expand All @@ -91,7 +96,7 @@ jobs:
repository: StevenMMortimer/salesforcer
event-type: main-02-test-coverage
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'

- name: Set final R-CMD-check status
if: ${{ (github.event_name != 'workflow_dispatch' && failure()) }}
uses: peter-evans/repository-dispatch@v1
Expand Down
37 changes: 20 additions & 17 deletions .github/workflows/main-02-test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ on:
schedule:
# Execute monthly at 9AM UTC (5AM ET during daylight savings, otherwise 4AM)
- cron: '0 9 1 * *'

jobs:
test-coverage:

runs-on: macOS-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
SALESFORCER_USERNAME: ${{ secrets.SALESFORCER_USERNAME }}
SALESFORCER_TOKEN_PATH: ${{ github.workspace }}/tests/testthat/

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.sha }}
- name: Decrypt OAuth Token
run: |
./.github/scripts/decrypt_secret.sh
env:
SALESFORCER_TOKEN_PASSPHRASE: ${{ secrets.SALESFORCER_TOKEN_PASSPHRASE }}

- name: Reveal env vars
run: |
echo GITHUB_WORKFLOW = $GITHUB_WORKFLOW
Expand All @@ -46,41 +46,44 @@ jobs:
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
echo GITHUB_SHA = $GITHUB_SHA
echo GITHUB_REF = $GITHUB_REF
- uses: r-lib/actions/setup-r@v1

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

- 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@v1
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-4.0-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.0-2-
key: macOS-r-4.4-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.4-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
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: Test coverage
run: covr::codecov(quiet=FALSE)
shell: Rscript {0}

- 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
Expand All @@ -89,7 +92,7 @@ jobs:
repository: StevenMMortimer/salesforcer
event-type: main-03-R-CMD-check-mac
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'

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

0 comments on commit 50ff1c0

Please sign in to comment.