Skip to content

Commit

Permalink
Merge pull request #3100 from mirpedrol/template-customisation-gitpod
Browse files Browse the repository at this point in the history
Template: add option to exclude gitpod for custom pipeline template
  • Loading branch information
mirpedrol authored Aug 7, 2024
2 parents 1f181c7 + ed4554d commit d04331e
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 256 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Use filename in code block for `params.yml` ([#3055](https://github.com/nf-core/tools/pull/3055))
- Remove release announcement for non nf-core pipelines ([#3072](https://github.com/nf-core/tools/pull/3072))
- add option to exclude code linters for custom pipeline template ([#3084](https://github.com/nf-core/tools/pull/3084))
- add option to exclude gitpod for custom pipeline template ([#3100](https://github.com/nf-core/tools/pull/3100))

### Linting

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
511 changes: 255 additions & 256 deletions tests/__snapshots__/test_create_app.ambr

Large diffs are not rendered by default.

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 d04331e

Please sign in to comment.