R-hub #3
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
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: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-r: true | |
- name: Install dependencies | |
run: | | |
install.packages("rhub") | |
rhub::rhub_setup() | |
linux-containers: | |
needs: setup | |
if: ${{ needs.setup.outputs.containers != '[]' }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
config: ${{ fromJson(needs.setup.outputs.containers) }} | |
container: | |
image: ${{ matrix.config.container }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup platform info | |
run: | | |
rhub::platform_info(job_config = "${{ matrix.config.job_config }}") | |
- name: Setup dependencies | |
run: | | |
rhub::setup_deps(job_config = "${{ matrix.config.job_config }}") | |
- name: Run checks | |
run: | | |
rhub::run_check(job_config = "${{ matrix.config.job_config }}") | |
other-platforms: | |
needs: setup | |
if: ${{ needs.setup.outputs.platforms != '[]' }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: ${{ fromJson(needs.setup.outputs.platforms) }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
job-config: ${{ matrix.config.job_config }} | |
token: ${{ secrets.RHUB_TOKEN }} | |
- name: Setup platform info | |
run: | | |
rhub::platform_info(job_config = "${{ matrix.config.job_config }}") | |
- name: Setup dependencies | |
run: | | |
rhub::setup_deps(job_config = "${{ matrix.config.job_config }}") | |
- name: Run checks | |
run: | | |
rhub::run_check(job_config = "${{ matrix.config.job_config }}") |