-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 71-with-nix # Conflicts: # NAMESPACE
- Loading branch information
Showing
12 changed files
with
320 additions
and
49 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,30 @@ | ||
# WARNING - Generated by {fusen} from dev/cicd.Rmd: do not edit by hand | ||
|
||
#' tar_nix_ga Run a {targets} pipeline on Github Actions. | ||
#' @details This function puts a `.yaml` file inside the `.github/workflows/` | ||
#' folders on the root of your project. This workflow file will use the | ||
#' projects `default.nix` file to generate the development environment on | ||
#' Github Actions and will then run the projects {targets} pipeline. Make | ||
#' sure to give read and write permissions to the Github Actions bot. | ||
#' @return Nothing, copies file to a diretory. | ||
#' @export | ||
tar_nix_ga <- function(){ | ||
# Add an empty .gitignore file if there isn’t any | ||
|
||
if(file.exists(".gitignore")){ | ||
NULL | ||
} else { | ||
file.create(".gitignore") | ||
} | ||
|
||
path <- ".github/workflows" | ||
|
||
dir.create(path, recursive = TRUE) | ||
source <- system.file( | ||
file.path("extdata", "run-pipeline.yaml"), | ||
package = "rix", | ||
mustWork = TRUE | ||
) | ||
file.copy(source, path, overwrite = TRUE) | ||
invisible() | ||
} |
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,7 +1,6 @@ | ||
# WARNING - Generated by {fusen} from dev/zzz.Rmd: do not edit by hand | ||
|
||
#' zzz | ||
#' | ||
#' Global imports | ||
#' zzz Global imports | ||
#' @noRd | ||
#' @importFrom utils data | ||
utils::globalVariables(c("r_nix_revs")) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
title: "Functions for Github Actions CI/CD service" | ||
output: html_document | ||
editor_options: | ||
chunk_output_type: console | ||
--- | ||
|
||
```{r development, include=FALSE} | ||
library(testthat) | ||
``` | ||
|
||
<!-- | ||
You need to run the 'description' chunk in the '0-dev_history.Rmd' file before continuing your code there. | ||
--> | ||
|
||
```{r development-load} | ||
# Load already included functions if relevant | ||
pkgload::load_all(export_all = FALSE) | ||
``` | ||
|
||
The function below copies a Github actions workflow file into the | ||
`.github/workflows/run-pipeline.yaml`: | ||
|
||
```{r function-tar_nix_ga} | ||
#' tar_nix_ga Run a {targets} pipeline on Github Actions. | ||
#' @details This function puts a `.yaml` file inside the `.github/workflows/` | ||
#' folders on the root of your project. This workflow file will use the | ||
#' projects `default.nix` file to generate the development environment on | ||
#' Github Actions and will then run the projects {targets} pipeline. Make | ||
#' sure to give read and write permissions to the Github Actions bot. | ||
#' @return Nothing, copies file to a diretory. | ||
#' @export | ||
tar_nix_ga <- function(){ | ||
# Add an empty .gitignore file if there isn’t any | ||
if(file.exists(".gitignore")){ | ||
NULL | ||
} else { | ||
file.create(".gitignore") | ||
} | ||
path <- ".github/workflows" | ||
dir.create(path, recursive = TRUE) | ||
source <- system.file( | ||
file.path("extdata", "run-pipeline.yaml"), | ||
package = "rix", | ||
mustWork = TRUE | ||
) | ||
file.copy(source, path, overwrite = TRUE) | ||
invisible() | ||
} | ||
``` | ||
|
||
Be sure to give Github Actions workflows read and write permissions. |
Oops, something went wrong.