Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add r-hub workflow #232

Merged
merged 43 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
58417b6
Update
walkowif May 15, 2024
16aeddf
Update
walkowif May 15, 2024
a8dfda5
Update
walkowif May 15, 2024
7b824e9
Update
walkowif May 15, 2024
4277a42
Cleanup
walkowif May 15, 2024
19a74de
Merge branch 'main' into test-rhub-workflows
walkowif Jun 24, 2024
3acdbb9
Merge branch 'main' into test-rhub-workflows
walkowif Jun 26, 2024
f51b1e5
Use custom dependency script
walkowif Jun 26, 2024
6427eb0
Merge branch 'test-rhub-workflows' of github.com:insightsengineering/…
walkowif Jun 26, 2024
ce5f2aa
Update
walkowif Jun 26, 2024
e69082b
Update
walkowif Jun 26, 2024
443c22f
Update
walkowif Jun 26, 2024
aecf95a
Update
walkowif Jun 26, 2024
b67f727
Update
walkowif Jun 26, 2024
0ae857d
Update
walkowif Jun 26, 2024
e6e70d7
Update
walkowif Jun 26, 2024
db7cb87
Uncomment setup-deps
walkowif Jun 26, 2024
5ffabaa
Update
walkowif Jun 26, 2024
c92a7a9
Update
walkowif Jun 26, 2024
ffeec8e
Update
walkowif Jun 26, 2024
665baf9
Update
walkowif Jun 27, 2024
d3aec3b
Update
walkowif Jun 27, 2024
eafd430
Update
walkowif Jun 27, 2024
cf9ba1f
Add inputs
walkowif Jun 27, 2024
aff3143
Update
walkowif Jun 27, 2024
f000196
Update
walkowif Jun 27, 2024
134c479
Test on additional platforms
walkowif Jun 27, 2024
9118023
Restore r-hub platforms
walkowif Jun 27, 2024
04cbfe9
Update
walkowif Jun 27, 2024
514babd
Update
walkowif Jun 27, 2024
c026191
Merge branch 'main' into test-rhub-workflows
cicdguy Jul 2, 2024
60a9b9b
Merge branch 'main' into test-rhub-workflows
walkowif Jul 3, 2024
9991e76
feat: update check list and action ref
walkowif Jul 3, 2024
83c14cd
Merge branch 'test-rhub-workflows' of github.com:insightsengineering/…
walkowif Jul 3, 2024
fbd6eb9
docs: add R-hub workflow screenshot
walkowif Jul 4, 2024
72a75c1
docs: add R-hub workflow description
walkowif Jul 4, 2024
61c1f9b
docs: update R-hub workflow description
walkowif Jul 4, 2024
46d94a0
fix: update the list of environments [skip ci]
walkowif Jul 4, 2024
06a089d
chore: update workflow step name
walkowif Jul 4, 2024
f1acdff
docs: update workflow screenshot
walkowif Jul 4, 2024
d2a844a
fix: add workflow concurrency settings
walkowif Jul 4, 2024
7cc33fb
feat: update check list
walkowif Jul 5, 2024
cc4fc0f
fix: update check list with a different yaml syntax to make it more r…
walkowif Jul 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions .github/workflows/rhub.yaml
walkowif marked this conversation as resolved.
Show resolved Hide resolved
pawelru marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# This workflow is based on R-hub's generic GitHub Actions workflow file.
# Its canonical location is at
# https://github.com/r-hub/actions/blob/main/workflows/rhub.yaml

name: R-hub 🌐

on:
pawelru marked this conversation as resolved.
Show resolved Hide resolved
workflow_call:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
# These platforms correspond roughly to CRAN package checks.
# More information: https://github.com/insightsengineering/idr-tasks/issues/781
# All supported R-hub platforms can be viewed by running: rhub::rhub_platforms()
# Container-based platforms (as opposed to VM-based Windows and macOS platforms)
# can be also viewed here: https://r-hub.github.io/containers/containers.html
default: 'ubuntu-clang,ubuntu-gcc12,gcc13,ubuntu-next,ubuntu-release,macos-arm64,macos,windows,gcc14,atlas,valgrind,intel,nosuggests,mkl'
walkowif marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening a separate thread to keep the discussion well organised.
This is the results for teal:
image

Take a look at the timings for valgrind. It took 4 times longer than the median timing of all the platforms. If the minutes consumption are in concern - maybe we can remove it? WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, GitHub minutes consumption is not a problem for public repositories (they are free) but we can remove any irrelevant checks, especially if they take a long time.

lookup-refs:
description: |
List of package references to be used for the feature branch.
Multiple entries in new lines or separated by commas.
required: false
default: ""
type: string

jobs:
setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}

steps:
- uses: r-hub/actions/setup@v1
with:
config: ${{ 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 }}

- name: Prepare DESCRIPTION file
uses: insightsengineering/setup-r-dependencies@main
with:
lookup-refs: ${{ inputs.lookup-refs }}
skip-install: true

- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
needs: DepsDev,DepsBranch

- 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 }}

- name: Setup R dependencies
uses: insightsengineering/setup-r-dependencies@main
with:
lookup-refs: ${{ inputs.lookup-refs }}
skip-install: true

- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
needs: DepsDev,DepsBranch

- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
Binary file added images/rhub-workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,9 @@ jobs:
needs: release
uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@main
```

## [`rhub.yaml`](./.github/workflows/rhub.yaml)

This is a workflow based on the [official R-hub workflow](https://github.com/r-hub/actions/blob/main/workflows/rhub.yaml) with the main goal being to `R CMD check` the package on different environments corresponding to the CRAN checks.

<img src="images/rhub-workflow.png" width="60%">
Loading