-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from rsquaredacademy/develop
Develop
- Loading branch information
Showing
51 changed files
with
334 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# R-hub's generic GitHub Actions workflow file. It's canonical location is at | ||
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml | ||
# You can update this file to a newer version using the rhub2 package: | ||
# | ||
# rhub::rhub_setup() | ||
# | ||
# It is unlikely that you need to modify this file manually. | ||
|
||
name: R-hub | ||
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
config: | ||
description: 'A comma separated list of R-hub platforms to use.' | ||
type: string | ||
default: 'linux,windows,macos' | ||
name: | ||
description: 'Run name. You can leave this empty now.' | ||
type: string | ||
id: | ||
description: 'Unique ID. You can leave this empty now.' | ||
type: string | ||
|
||
jobs: | ||
|
||
setup: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
containers: ${{ steps.rhub-setup.outputs.containers }} | ||
platforms: ${{ steps.rhub-setup.outputs.platforms }} | ||
|
||
steps: | ||
# NO NEED TO CHECKOUT HERE | ||
- uses: r-hub/actions/setup@v1 | ||
with: | ||
config: ${{ github.event.inputs.config }} | ||
id: rhub-setup | ||
|
||
linux-containers: | ||
needs: setup | ||
if: ${{ needs.setup.outputs.containers != '[]' }} | ||
runs-on: ubuntu-latest | ||
name: ${{ matrix.config.label }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: ${{ fromJson(needs.setup.outputs.containers) }} | ||
container: | ||
image: ${{ matrix.config.container }} | ||
|
||
steps: | ||
- uses: r-hub/actions/checkout@v1 | ||
- uses: r-hub/actions/platform-info@v1 | ||
with: | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
job-config: ${{ matrix.config.job-config }} | ||
- uses: r-hub/actions/setup-deps@v1 | ||
with: | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
job-config: ${{ matrix.config.job-config }} | ||
- uses: r-hub/actions/run-check@v1 | ||
with: | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
job-config: ${{ matrix.config.job-config }} | ||
|
||
other-platforms: | ||
needs: setup | ||
if: ${{ needs.setup.outputs.platforms != '[]' }} | ||
runs-on: ${{ matrix.config.os }} | ||
name: ${{ matrix.config.label }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: ${{ fromJson(needs.setup.outputs.platforms) }} | ||
|
||
steps: | ||
- uses: r-hub/actions/checkout@v1 | ||
- uses: r-hub/actions/setup-r@v1 | ||
with: | ||
job-config: ${{ matrix.config.job-config }} | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
- uses: r-hub/actions/platform-info@v1 | ||
with: | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
job-config: ${{ matrix.config.job-config }} | ||
- uses: r-hub/actions/setup-deps@v1 | ||
with: | ||
job-config: ${{ matrix.config.job-config }} | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
- uses: r-hub/actions/run-check@v1 | ||
with: | ||
job-config: ${{ matrix.config.job-config }} | ||
token: ${{ secrets.RHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,61 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
branches: [master, develop] | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
branches: [master, develop] | ||
|
||
name: test-coverage | ||
name: test-coverage.yaml | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
test-coverage: | ||
runs-on: macOS-latest | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v1 | ||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-pandoc@v1 | ||
- 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) | ||
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") | ||
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@v2 | ||
- uses: codecov/codecov-action@v4 | ||
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 | ||
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} | ||
file: ./cobertura.xml | ||
plugin: noop | ||
disable_search: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Show testthat output | ||
if: always() | ||
run: | | ||
install.packages(c("remotes")) | ||
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: Test coverage | ||
run: covr::codecov() | ||
shell: Rscript {0} | ||
- name: Upload test results | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-test-failures | ||
path: ${{ runner.temp }}/package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.