Skip to content

Commit

Permalink
add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
yannfeat committed Jan 11, 2024
1 parent 37b826a commit 0bf169c
Show file tree
Hide file tree
Showing 7 changed files with 265 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
action.yml
README.md
.gitignore
LICENSE
tests/
.github/
readme_files/
28 changes: 28 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: SuperLinter

on:
pull_request:
branches:
- main

jobs:
lint:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Lint Code Base
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
VALIDATE_R: true
VALIDATE_YAML: true
VALIDATE_BASH_EXEC: true
VALIDATE_DOCKERFILE_HADOLINT: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/short-tagging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Keep the versions up-to-date ☕️

on:
release:
types: [published, edited]

jobs:
actions-tagger:
runs-on: ubuntu-latest
steps:
- uses: Actions-R-Us/actions-tagger@latest
with:
publish_latest_tag: true
47 changes: 47 additions & 0 deletions .github/workflows/test_no_cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Test This Action without cache

on:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
name: ${{ matrix.package.name }}
container:
image: rocker/verse:4.1.2
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
max-parallel: 2
matrix:
package:
- name: buckbeak
report_pkg_dir: ./tests/packages/buckbeak
report_template_path: ./tests/packages/buckbeak/validation-template.Rmd
report_rmarkdown_format: html_document

steps:
- name: Checkout ${{ matrix.package.name }}
uses: actions/checkout@v3

- name: Generate validation report for ${{ matrix.package.name }}
uses: ./
id: validation
with:
report_pkg_dir: ${{ matrix.package.report_pkg_dir }}
report_template_path: ${{ matrix.package.report_template_path }}
report_output_prefix: validation_report
report_rmarkdown_format: ${{ matrix.package.report_rmarkdown_format }}
no_cache: true

- name: Upload ${{ matrix.package.name }} validation report
uses: actions/upload-artifact@v2
if: success()
with:
name: ${{ matrix.package.name }} validation report
path: ${{ steps.validation.outputs.report_output_filename }}
if-no-files-found: error
115 changes: 115 additions & 0 deletions .github/workflows/val-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
name: Test This Action

on:
pull_request:
branches:
- val-pipeline-mvp

jobs:
val-pipeline-target:
runs-on: ubuntu-latest
name: ${{ matrix.package.name }}
container:
image: rocker/verse:4.1.2
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
max-parallel: 2
with:
target: buckbeak
report_pkg_dir: ./tests/packages/buckbeak
report_template_path: ./tests/packages/buckbeak/validation-template.Rmd
report_rmarkdown_format: html_document
additional_tlmgr_packages: "courier ec"
steps:
- name: Checkout ${{ matrix.package.name }}
uses: actions/checkout@v3

- name: Generate validation report for ${{ matrix.package.name }}
id: validation
uses: ./
with:
report_pkg_dir: ${{ matrix.package.report_pkg_dir }}
report_template_path: ${{ matrix.package.report_template_path }}
report_output_prefix: validation_report
report_rmarkdown_format: ${{ matrix.package.report_rmarkdown_format }}
additional_tlmgr_packages: ${{ matrix.package.additional_tlmgr_packages }}

- name: Upload ${{ matrix.package.name }} validation report
uses: actions/upload-artifact@v2
if: success()
with:
name: ${{ matrix.package.name }} validation report
path: ${{ steps.validation.outputs.report_output_filename }}
if-no-files-found: error

val-pipeline-dependencies:
runs-on: ubuntu-latest
name: ${{ matrix.package.name }}
container:
image: rocker/verse:4.1.2
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CRAN: https://packagemanager.rstudio.com/cran/__linux__/focal/latest
with:
report_template_path: ./tests/packages/buckbeak/validation-template.Rmd
report_rmarkdown_format: html_document
additional_tlmgr_packages: "courier ec
strategy:
fail-fast: false
max-parallel: 2
matrix:
dependency:
- name: lattice
version: 0.20-45
- name: lazyeval
version: 0.2.2
- name: lubridate
version: 1.9.2
steps:
- name: Checkout ${{ matrix.package.name }}
uses: actions/checkout@v3
- name: Set R options
run: |
echo 'options(repos = "${{ CRAN }}", Ncpus = 2, crayon.enabled = TRUE)' >> ~/.Rprofile

- name: Set up R library
run: |
mkdir -p ./R_LIBS_USER
echo '.libPaths("./R_LIBS_USER")' >> ~/.Rprofile
- name: Install dependency
run: |
R -q -e 'remotes_url <- "https://packagemanager.posit.co/cran/latest/src/contrib/Archive/remotes/remotes_2.4.2.tar.gz";
install.packages(remotes_url, repos = NULL, type = "source",
dependencies = c("Depends", "Imports"),
INSTALL_opts = c("--no-docs", "--clean", "--no-multiarch",
"--no-data", "--no-help", "--no-demo")
);
library(remotes);
install_version(
${{ matrix.dependency.name }},
version = ${{ matrix.dependency.version }},
dependencies = FALSE
)'
- name: Generate validation report for ${{ matrix.dependency.name }}
id: validation
uses: ./
with:
report_pkg_dir: ${{ report_pkg_dir }}
report_template_path: ${{ report_template_path }}
report_output_prefix: validation_report
report_rmarkdown_format: ${{ report_rmarkdown_format }}
additional_tlmgr_packages: ${{ additional_tlmgr_packages }}

- name: Upload ${{ matrix.dependency.name }} validation report
uses: actions/upload-artifact@v2
if: success()
with:
name: ${{ matrix.dependency.name }} validation report
path: ${{ steps.validation.outputs.report_output_filename }}
if-no-files-found: error
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,57 @@
# For Quarto publish
site_libs/*
_site/*
_freeze/*
.nojekyll
*.html
sitemap.xml
search.json

# MacOS
.DS_Store

# History files
.Rhistory
.Rapp.history

# Session Data files
.RData

# User-specific files
.Ruserdata

# Example code in package build process
*-Ex.R

# Output files from R CMD build
/*.tar.gz

# Output files from R CMD check
/*.Rcheck/

# RStudio files
.Rproj.user/

# produced vignettes
vignettes/*.html
vignettes/*.pdf

# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth

# knitr and R markdown default cache directories
*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md

# R Environment Variables
.Renviron

# pkgdown site
docs/

# translation temp files
po/*~
5 changes: 5 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
linters: with_defaults(
line_length_linter = line_length_linter(120),
cyclocomp_linter = NULL,
object_usage_linter = NULL
)

0 comments on commit 0bf169c

Please sign in to comment.