-
Notifications
You must be signed in to change notification settings - Fork 3
Add runner tag option for GitLab CI #10
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
Merged
VincentGuyader
merged 8 commits into
main
from
codex/ajouter-un-choix-de-tag-pour-le-job-gitlab
Jun 6, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
984b1dc
Allow multiple runner tags in GitLab CI
VincentGuyader f52c1a0
Update tests/testthat/test-set_gitlab_ci.R
VincentGuyader 4c195d9
Update R/set_gitlab_ci.R
VincentGuyader 6db9a5a
bump to dev version
VincentGuyader bf79ef7
Allow multiple runner tags in GitLab CI
VincentGuyader ed40a55
Update tests/testthat/test-set_gitlab_ci.R
VincentGuyader d5964b9
update doc
VincentGuyader 3a1e16b
improve test
VincentGuyader File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,4 +1,5 @@ | ||
| Version: 1.0 | ||
| ProjectId: 77ecc2cf-a94d-4ad3-a353-68d0edad10ea | ||
|
|
||
| RestoreWorkspace: No | ||
| SaveWorkspace: No | ||
|
|
||
This file contains hidden or 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,31 @@ | ||
| # Test de la fonction set_gitlab_ci avec et sans tags | ||
|
|
||
| # Charger la fonction | ||
| source("R/set_gitlab_ci.R") | ||
|
|
||
| # Test 1: Sans tags | ||
| cat("=== Test 1: Sans tags ===\n") | ||
| temp_dir1 <- tempdir() | ||
| result1 <- set_gitlab_ci(path = temp_dir1) | ||
| cat("Résultat:", result1, "\n") | ||
|
|
||
| # Afficher le contenu généré | ||
| cat("\nContenu généré (sans tags):\n") | ||
| content1 <- readLines(file.path(temp_dir1, ".gitlab-ci.yml")) | ||
| cat(content1, sep = "\n") | ||
|
|
||
| cat("\n\n=== Test 2: Avec tags ===\n") | ||
| # Test 2: Avec tags | ||
| temp_dir2 <- file.path(tempdir(), "test_with_tags") | ||
| dir.create(temp_dir2, showWarnings = FALSE) | ||
| result2 <- set_gitlab_ci(path = temp_dir2, tags = c("docker", "linux")) | ||
| cat("Résultat:", result2, "\n") | ||
|
|
||
| # Afficher le contenu généré | ||
| cat("\nContenu généré (avec tags):\n") | ||
| content2 <- readLines(file.path(temp_dir2, ".gitlab-ci.yml")) | ||
| cat(content2, sep = "\n") | ||
|
|
||
| # Vérifier que les tags sont présents | ||
| has_tags <- any(grepl("tags:", content2)) | ||
| cat("\nTags détectés dans le fichier:", has_tags, "\n") |
This file contains hidden or 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,15 @@ | ||
| library(testthat) | ||
|
|
||
| # Create temp directory for testing | ||
| tmp_dir <- tempfile() | ||
|
|
||
| test_that("set_gitlab_ci inserts multiple tags", { | ||
| set_gitlab_ci(path = tmp_dir, tags = c("shiny_build", "prod")) | ||
| expect_true(file.exists(file.path(tmp_dir, ".gitlab-ci.yml"))) | ||
| ci_lines <- readLines(file.path(tmp_dir, ".gitlab-ci.yml")) | ||
| expect_true(any(grepl("^\\s*tags:\\s*$", ci_lines))) | ||
| expect_true(any(grepl("^\\s*tags:\\s*$", ci_lines))) | ||
| expect_true(any(grepl("shiny_build", ci_lines))) | ||
| expect_true(any(grepl("prod", ci_lines))) | ||
| file.remove(file.path(tmp_dir, ".gitlab-ci.yml")) | ||
| }) |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.