Skip to content
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

Don't check for docker pull commands in actions_ci lint test (leftover from DSL1) #2055

Merged
merged 2 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### Linting

- Don't lint pipeline name if `manifest.name` in `.nf-core.yml` ([#2035](https://github.com/nf-core/tools/pull/2035))
- Don't check for `docker pull` commands in `actions_ci` lint test (leftover from DSL1)

### General

Expand Down
67 changes: 0 additions & 67 deletions nf_core/lint/actions_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,6 @@ def actions_ci(self):
.. note:: These ``matrix`` variables run the test workflow twice, varying the ``nxf_ver`` variable each time.
This is used in the ``nextflow run`` commands to test the pipeline with both the latest available version
of the pipeline (``''``) and the stated minimum required version.

* The `Docker` container for the pipeline must use the correct pipeline version number:

* Development pipelines:

.. code-block:: bash

docker tag nfcore/<pipeline_name>:dev nfcore/<pipeline_name>:dev

* Released pipelines:

.. code-block:: bash

docker tag nfcore/<pipeline_name>:dev nfcore/<pipeline_name>:<pipeline-version>

* Complete example for a released pipeline called *nf-core/example* with version number ``1.0.0``:

.. code-block:: yaml
:emphasize-lines: 3,8,9

- name: Build new docker image
if: env.GIT_DIFF
run: docker build --no-cache . -t nfcore/example:1.0.0

- name: Pull docker image
if: ${{ !env.GIT_DIFF }}
run: |
docker pull nfcore/example:dev
docker tag nfcore/example:dev nfcore/example:1.0.0
"""
passed = []
failed = []
Expand Down Expand Up @@ -101,44 +72,6 @@ def actions_ci(self):
else:
passed.append("'.github/workflows/ci.yml' is triggered on expected events")

# Check that we're pulling the right docker image and tagging it properly
if self.nf_config.get("process.container", ""):
docker_notag = re.sub(r":(?:[\.\d]+|dev)$", "", self.nf_config.get("process.container", "").strip("\"'"))
docker_withtag = self.nf_config.get("process.container", "").strip("\"'")

# docker build
docker_build_cmd = f"docker build --no-cache . -t {docker_withtag}"
try:
steps = ciwf["jobs"]["test"]["steps"]
if not any(docker_build_cmd in step["run"] for step in steps if "run" in step.keys()):
raise AssertionError()
except (AssertionError, KeyError, TypeError):
failed.append(f"CI is not building the correct docker image. Should be: `{docker_build_cmd}`")
else:
passed.append(f"CI is building the correct docker image: `{docker_build_cmd}`")

# docker pull
docker_pull_cmd = f"docker pull {docker_notag}:dev"
try:
steps = ciwf["jobs"]["test"]["steps"]
if not any(docker_pull_cmd in step["run"] for step in steps if "run" in step.keys()):
raise AssertionError()
except (AssertionError, KeyError, TypeError):
failed.append(f"CI is not pulling the correct docker image. Should be: `{docker_pull_cmd}`")
else:
passed.append(f"CI is pulling the correct docker image: {docker_pull_cmd}")

# docker tag
docker_tag_cmd = f"docker tag {docker_notag}:dev {docker_withtag}"
try:
steps = ciwf["jobs"]["test"]["steps"]
if not any(docker_tag_cmd in step["run"] for step in steps if "run" in step.keys()):
raise AssertionError()
except (AssertionError, KeyError, TypeError):
failed.append(f"CI is not tagging docker image correctly. Should be: `{docker_tag_cmd}`")
else:
passed.append(f"CI is tagging docker image correctly: {docker_tag_cmd}")

# Check that we are testing the minimum nextflow version
try:
nxf_ver = ciwf["jobs"]["test"]["strategy"]["matrix"]["NXF_VER"]
Expand Down