mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-15 09:24:52 +03:00
Added a github workflow option for CI
This commit is contained in:
parent
42bd7108ac
commit
91440516ff
|
@ -123,10 +123,6 @@ def remove_dotgitlabciyml_file():
|
|||
os.remove(".gitlab-ci.yml")
|
||||
|
||||
|
||||
# def remove_dotgithubciyml_file():
|
||||
# os.remove(".github-ci.yml")
|
||||
|
||||
|
||||
def remove_dotgithub_folder():
|
||||
shutil.rmtree(".github")
|
||||
|
||||
|
@ -403,9 +399,6 @@ def main():
|
|||
if "{{ cookiecutter.ci_tool }}".lower() != "gitlab":
|
||||
remove_dotgitlabciyml_file()
|
||||
|
||||
# if "{{ cookiecutter.ci_tool }}".lower() != "github":
|
||||
# remove_dotgithubciyml_file()
|
||||
|
||||
if "{{ cookiecutter.ci_tool }}".lower() != "github":
|
||||
remove_dotgithub_folder()
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ from binaryornot.check import is_binary
|
|||
PATTERN = r"{{(\s?cookiecutter)[.](.*?)}}"
|
||||
RE_OBJ = re.compile(PATTERN)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def context():
|
||||
return {
|
||||
|
@ -139,6 +138,7 @@ def check_paths(paths):
|
|||
@pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id)
|
||||
def test_project_generation(cookies, context, context_override):
|
||||
"""Test that project is generated and fully rendered."""
|
||||
|
||||
result = cookies.bake(extra_context={**context, **context_override})
|
||||
assert result.exit_code == 0
|
||||
assert result.exception is None
|
||||
|
@ -245,7 +245,7 @@ def test_github_invokes_flake8_and_pytest(
|
|||
assert result.project.basename == context["project_slug"]
|
||||
assert result.project.isdir()
|
||||
|
||||
with open(f"{result.project}/.github/workflows/.github-ci.yml", "r") as github_yml:
|
||||
with open(f"{result.project}/.github/workflows/github-ci.yml", "r") as github_yml:
|
||||
try:
|
||||
github_config = yaml.safe_load(github_yml)
|
||||
assert github_config["flake8"]["script"] == ["flake8"]
|
||||
|
|
7
{{cookiecutter.project_slug}}/.github/dependabot.yml
vendored
Normal file
7
{{cookiecutter.project_slug}}/.github/dependabot.yml
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
version: 2
|
||||
updates:
|
||||
# Update Github actions in workflows
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
Loading…
Reference in New Issue
Block a user