Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@ body:
attributes:
value: |
Please be sure to include as much details and indications as possible (and applicable)!
- type: dropdown
id: task-type
attributes:
label: What type of Task are you filling?
multiple: false
options:
- New Feature
- Maintenance
- Improvement
- Idea
- Other
validations:
required: true
- type: textarea
id: Suggestion
id: summary
attributes:
label: Suggestion / Feature
description: Describe the task to be carried out.
label: Description
description: Describe what do you have in your mind.
placeholder: Implement a new awesome feature that makes coffee! or Add some tests!
validations:
required: true
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository can be used for adding Github Actions and templates to an existi

## Version

Current version is 1.1.0 and was set according to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Current version is 1.2.0 and was set according to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Project's version should be updated, when applicable:

Expand Down Expand Up @@ -44,12 +44,14 @@ you will be prompted to fill in the following values:
folder.
- **add_PR_template:** this flags controls wether or not to add a PR template in the generated
folder.
- **project_language:** This variable choice serves to select the main project language, and it is
aligned with the actions that will be later opt to be created.
- **add_ci_action_unit_tests_runner:** this variable controls whether or not to create an action to
run unit tests in the repository. The available choices are:
- none (no action created).
run unit tests in the repository. The available actions (per project_language variable) are:
- cpp, which creates an action for Catch2 based unit tests, built using CMake.
- python, which creates an action for Python code unit tests, executed with pytest over a
- python, which creates an action for Python code unit tests, executed with pytest over a
project built with Poetry.
- other, which does not generate any action.

## Contributing

Expand Down
10 changes: 7 additions & 3 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
true,
false
],
"add_ci_action_unit_tests_runner": [
"none",
"project_language": [
"cpp",
"python"
"python",
"other"
],
"add_ci_action_unit_tests_runner": [
true,
false
],
"__github_folder": ".github"
}
10 changes: 5 additions & 5 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging
from pathlib import Path
from shutil import rmtree, copy, copytree
from shutil import rmtree, copytree


def change_line_endings_crlf_to_lf():
Expand All @@ -29,22 +29,22 @@ def remove_unwanted_templates():
def add_ci_action_unit_tests_runner():
"""Adds a CI action for running unit tests, if applicable"""

target_ci_tests_action = "{{cookiecutter.add_ci_action_unit_tests_runner}}"
target_language = "{{cookiecutter.project_language}}"

if target_ci_tests_action.lower() != "none":
if {{cookiecutter.add_ci_action_unit_tests_runner}} and target_language.lower() != "other":

LOG.info("Adding action for running unit tests (workflows folder) with default config...")

destination = Path("workflows")
ci_test_workflow_files_path = Path("_", "workflows", target_ci_tests_action)
ci_test_workflow_files_path = Path("_", "workflows", target_language)
copytree(ci_test_workflow_files_path, destination)

print("\n\n#################################################################")
print("# Please check gen. checklist in order to adjust CI UT basic action #")
print("#################################################################\n\n")

else:
LOG.info("Skipping CI action for running unit tests file generation (%s selected) ...", target_ci_tests_action)
LOG.info("Skipping CI action for running unit tests file generation (%s language selected) ...", target_language)


def clean():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@ body:
attributes:
value: |
Please be sure to include as much details and indications as possible (and applicable)!
- type: dropdown
id: task-type
attributes:
label: What type of Task are you filling?
multiple: false
options:
- New Feature
- Maintenance
- Improvement
- Idea
- Other
validations:
required: true
- type: textarea
id: Suggestion
id: summary
attributes:
label: Suggestion / Feature
description: Describe the task to be carried out.
label: Description
description: Describe what do you have in your mind.
placeholder: Implement a new awesome feature that makes coffee! or Add some tests!
validations:
required: true
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ it to the remote repository.
(defaults to *ubuntu-22.04*, hosted by GH).
- [ ] The credentials for acquiring the Docker image(if needed) have been configured via secrets
and required section in action file uncommented.

In GitHub's repository settings >> Branches >> Branch protection rules >> Enable 'Require status
checks to pass before merging'.
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ it to the remote repository.
- [ ] The target test directory where tests live has been defined (defaults to *tests*).
- [ ] The target runner(s) in which to run the CI Unit Testing workflow have been configured
(defaults to *ubuntu-22.04*, hosted by GH).

Note that, for a PR to be blocked if Unit Testing action fails, status checks must be enabled on the
target branch.

In GitHub's repository settings >> Branches >> Branch protection rules >> Enable 'Require status
checks to pass before merging'.