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

Pipeline template: Fix the faulty Download test / GitHub action #3389

Merged
merged 3 commits into from
Jan 13, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Download

- Allow `nf-core pipelines download -r` to download commits ([#3374](https://github.com/nf-core/tools/pull/3374))
- Fix faulty Download Test Action to ensure that setup and test run as one job and on the same runner ([#3389](https://github.com/nf-core/tools/pull/3389))

### Linting

Expand Down
34 changes: 19 additions & 15 deletions nf_core/pipeline-template/.github/workflows/download_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,18 @@ jobs:
REPOTITLE_LOWERCASE: ${{ steps.get_repo_properties.outputs.REPOTITLE_LOWERCASE }}
REPO_BRANCH: ${{ steps.get_repo_properties.outputs.REPO_BRANCH }}
steps:
- name: Install Nextflow{% endraw %}
- name: Get the repository name and current branch
id: get_repo_properties
run: |
echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> "$GITHUB_OUTPUT"
echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> "$GITHUB_OUTPUT{% endraw %}"

download:
runs-on: ubuntu-latest
needs: configure
steps:
- name: Install Nextflow
uses: nf-core/setup-nextflow@v2

- name: Disk space cleanup
Expand All @@ -56,24 +67,13 @@ jobs:
python -m pip install --upgrade pip
pip install git+https://github.com/nf-core/tools.git@dev

- name: Get the repository name and current branch set as environment variable
id: get_repo_properties
run: |
echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> "$GITHUB_OUTPUT"
echo "{% raw %}REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> "$GITHUB_OUTPUT"

- name: Make a cache directory for the container images
run: |
mkdir -p ./singularity_container_images

download:
runs-on: ubuntu-latest
needs: configure
steps:
- name: Download the pipeline
env:
NXF_SINGULARITY_CACHEDIR: ./singularity_container_images
NXF_SINGULARITY_CACHEDIR: ./singularity_container_images{% raw %}
run: |
nf-core pipelines download ${{ needs.configure.outputs.REPO_LOWERCASE }} \
--revision ${{ needs.configure.outputs.REPO_BRANCH }} \
Expand All @@ -85,7 +85,10 @@ jobs:
--download-configuration 'yes'

- name: Inspect download
run: tree ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }}{% endraw %}{% if test_config %}{% raw %}
run: tree ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }}{% endraw %}

- name: Inspect container images
run: tree ./singularity_container_images | tee ./container_initial{% if test_config %}{% raw %}

- name: Count the downloaded number of container images
id: count_initial
Expand Down Expand Up @@ -123,7 +126,8 @@ jobs:
final_count=${{ steps.count_afterwards.outputs.IMAGE_COUNT_AFTER }}
difference=$((final_count - initial_count))
echo "$difference additional container images were \n downloaded at runtime . The pipeline has no support for offline runs!"
tree ./singularity_container_images
tree ./singularity_container_images > ./container_afterwards
diff ./container_initial ./container_afterwards
exit 1
else
echo "The pipeline can be downloaded successfully!"
Expand Down
Loading