Skip to content

Commit

Permalink
add option to exclude gitpod for custom pipeline template
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol committed Aug 5, 2024
1 parent 198c6dc commit f432360
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/create-test-lint-wf-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- "template_skip_igenomes.yml"
- "template_skip_ci.yml"
- "template_skip_code_linters.yml"
- "template_skip_gitpod.yml"
runner:
# use the runner given by the input if it is dispatched manually, run on github if it is a rerun or on self-hosted by default
- ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }}
Expand Down Expand Up @@ -107,6 +108,10 @@ jobs:
run: |
printf "org: my-prefix\nskip: code_linters" > create-test-lint-wf/template_skip_code_linters.yml
- name: Create template skip gitpod
run: |
printf "org: my-prefix\nskip: gitpod" > create-test-lint-wf/template_skip_gitpod.yml
# Create a pipeline from the template
- name: create a pipeline from the template ${{ matrix.TEMPLATE }}
run: |
Expand Down
2 changes: 2 additions & 0 deletions nf_core/pipeline-template/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,13 @@ profiles {
wave.freeze = true
wave.strategy = 'conda,container'
}
{%- if gitpod %}
gitpod {
executor.name = 'local'
executor.cpus = 4
executor.memory = 8.GB
}
{%- endif %}
test { includeConfig 'conf/test.config' }
test_full { includeConfig 'conf/test_full.config' }
}
Expand Down
2 changes: 2 additions & 0 deletions nf_core/pipelines/create/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def __init__(
".prettierrc.yml",
".github/workflows/fix-linting.yml",
],
"gitpod": [".gitpod.yml"],
}
# Get list of files we're skipping with the supplied skip keys
self.skip_paths = set(sp for k in skip_paths for sp in skippable_paths[k])
Expand Down Expand Up @@ -210,6 +211,7 @@ def obtain_jinja_params_dict(self, features_to_skip, pipeline_dir):
"igenomes": {"file": True, "content": True},
"nf_core_configs": {"file": False, "content": True},
"code_linters": {"file": True, "content": True},
"gitpod": {"file": True, "content": True},
}

# Set the parameters for the jinja template
Expand Down
13 changes: 13 additions & 0 deletions nf_core/pipelines/create/custompipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
- prettier (https://github.com/prettier/prettier): enforces a consistent style (indentation, quoting, line length, etc).
"""

markdown_gitpod = """
Gitpod (https://www.gitpod.io/) provides standardized and automated development environments.
Including this to your pipeline will provide an environment with the latest version of nf-core/tools installed and all its requirements.
This is useful to have all the tools ready for pipeline development.
"""


class CustomPipeline(Screen):
"""Select if the pipeline will use genomic data."""
Expand Down Expand Up @@ -96,6 +103,12 @@ def compose(self) -> ComposeResult:
"The pipeline will include code linters and CI tests to lint your code: pre-commit, editor-config and prettier.",
"code_linters",
),
PipelineFeature(
markdown_gitpod,
"Include a gitpod environment",
"Include the configuration required to use Gitpod.",
"gitpod",
),
classes="features-container",
)
yield Center(
Expand Down
1 change: 1 addition & 0 deletions tests/data/pipeline_create_template_skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ skip_features:
- igenomes
- nf_core_configs
- code_linters
- gitpod

0 comments on commit f432360

Please sign in to comment.