-
Notifications
You must be signed in to change notification settings - Fork 6
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 #324 from insightsengineering/cran-release
Cran release
- Loading branch information
Showing
16 changed files
with
273 additions
and
134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,8 @@ | |
|
||
^CRAN-SUBMISSION$ | ||
^cran-comments\.md$ | ||
^.vscode$ | ||
^.vscode$ | ||
|
||
^.*\.tar\.gz$ | ||
^.*\.Rcheck$ | ||
|
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
|
||
name: 'Build src' | ||
description: 'Build src!' | ||
inputs: | ||
slim: | ||
description: 'Should the reduced set of checks be run' | ||
default: false | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Build R package | ||
shell: bash | ||
run: | | ||
R CMD build . | ||
- name: Run R CMD check | ||
env: | ||
_R_CHECK_CRAN_INCOMING_: false | ||
_R_CHECK_CRAN_INCOMING_REMOTE_: false | ||
shell: bash | ||
run: | | ||
echo "inputs.slim = ${{ inputs.slim }}" | ||
if ${{ inputs.slim }} ; then | ||
R CMD check --no-manual --no-build-vignettes --no-vignettes --ignore-vignettes *.tar.gz | ||
else | ||
R CMD check --no-manual --as-cran *.tar.gz | ||
fi | ||
- name: Catch warnings in R CMD check output | ||
id: catch-errors | ||
shell: Rscript {0} | ||
run: | | ||
check_dir <- grep("*\\.Rcheck$", list.dirs(), value = TRUE) | ||
check_log <- sprintf("%s/00check.log", check_dir) | ||
if (file.exists(check_log)) { | ||
x <- tail(readLines(check_log), 1) | ||
if (!grepl("^Status", x)) stop("No status line found in R CMD check log") | ||
if (grepl("ERROR", x)) stop("R CMD check has errors") | ||
if (grepl("WARNING", x)) stop("R CMD check has warnings") | ||
} else { | ||
stop("Could not find check log") | ||
} |
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,83 @@ | ||
name: Build latest version Docker images | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
on: | ||
schedule: | ||
- cron: '0 5 1,15 * *' | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build & Deploy Docker Images | ||
|
||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
config: | ||
- { | ||
src_image: "rocker/r-ver:latest", | ||
cran_url: "https://packagemanager.rstudio.com/cran/latest", | ||
tag: "rbmi:latest" | ||
} | ||
|
||
# Token permissions | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
# Build steps | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
id: buildx | ||
with: | ||
install: true | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: docker-cache-${{ matrix.config.tag }} | ||
|
||
|
||
- name: debug | ||
run: | | ||
echo push = ${{ github.event_name == 'push' }} | ||
echo tag = ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.config.tag }} | ||
echo IMAGE=${{ matrix.config.src_image }} | ||
echo CRANURL=${{ matrix.config.cran_url }} | ||
- name: Build and push image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./misc/docker | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.config.tag }} | ||
build-args: | | ||
IMAGE=${{ matrix.config.src_image }} | ||
CRANURL=${{ matrix.config.cran_url }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
|
||
# Fix bug where docker cache just continiously grows as it doesn't purge older layers | ||
# That are no longer in use | ||
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#local-cache | ||
- name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.