2828 NXF_ANSI_LOG : false
2929
3030jobs :
31+ configure :
32+ runs-on : ubuntu-latest
33+ outputs :
34+ REPO_LOWERCASE : ${{ steps.get_repo_properties.outputs.REPO_LOWERCASE }}
35+ REPOTITLE_LOWERCASE : ${{ steps.get_repo_properties.outputs.REPOTITLE_LOWERCASE }}
36+ REPO_BRANCH : ${{ steps.get_repo_properties.outputs.REPO_BRANCH }}
37+ steps :
38+ - name : Get the repository name and current branch
39+ id : get_repo_properties
40+ run : |
41+ echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
42+ echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> "$GITHUB_OUTPUT"
43+ echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> "$GITHUB_OUTPUT"
44+
3145 download :
3246 runs-on : ubuntu-latest
47+ needs : configure
3348 steps :
3449 - name : Install Nextflow
3550 uses : nf-core/setup-nextflow@v2
5267 python -m pip install --upgrade pip
5368 pip install git+https://github.com/nf-core/tools.git@dev
5469
55- - name : Get the repository name and current branch set as environment variable
56- run : |
57- echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
58- echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV}
59- echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> ${GITHUB_ENV}
60-
6170 - name : Make a cache directory for the container images
6271 run : |
6372 mkdir -p ./singularity_container_images
@@ -66,55 +75,59 @@ jobs:
6675 env :
6776 NXF_SINGULARITY_CACHEDIR : ./singularity_container_images
6877 run : |
69- nf-core pipelines download ${{ env .REPO_LOWERCASE }} \
70- --revision ${{ env .REPO_BRANCH }} \
71- --outdir ./${{ env .REPOTITLE_LOWERCASE }} \
78+ nf-core pipelines download ${{ needs.configure.outputs .REPO_LOWERCASE }} \
79+ --revision ${{ needs.configure.outputs .REPO_BRANCH }} \
80+ --outdir ./${{ needs.configure.outputs .REPOTITLE_LOWERCASE }} \
7281 --compress "none" \
7382 --container-system 'singularity' \
7483 --container-library "quay.io" -l "docker.io" -l "community.wave.seqera.io/library/" \
7584 --container-cache-utilisation 'amend' \
7685 --download-configuration 'yes'
7786
7887 - name : Inspect download
79- run : tree ./${{ env.REPOTITLE_LOWERCASE }}
88+ run : tree ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }}
89+
90+ - name : Inspect container images
91+ run : tree ./singularity_container_images | tee ./container_initial
8092
8193 - name : Count the downloaded number of container images
8294 id : count_initial
8395 run : |
8496 image_count=$(ls -1 ./singularity_container_images | wc -l | xargs)
8597 echo "Initial container image count: $image_count"
86- echo "IMAGE_COUNT_INITIAL=$image_count" >> ${GITHUB_ENV}
98+ echo "IMAGE_COUNT_INITIAL=$image_count" >> "$GITHUB_OUTPUT"
8799
88100 - name : Run the downloaded pipeline (stub)
89101 id : stub_run_pipeline
90102 continue-on-error : true
91103 env :
92104 NXF_SINGULARITY_CACHEDIR : ./singularity_container_images
93105 NXF_SINGULARITY_HOME_MOUNT : true
94- run : nextflow run ./${{ env. REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env .REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results
106+ run : nextflow run ./${{needs.configure.outputs. REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ needs.configure.outputs .REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results
95107 - name : Run the downloaded pipeline (stub run not supported)
96108 id : run_pipeline
97- if : ${{ job. steps.stub_run_pipeline.status == failure() }}
109+ if : ${{ steps.stub_run_pipeline.outcome == ' failure' }}
98110 env :
99111 NXF_SINGULARITY_CACHEDIR : ./singularity_container_images
100112 NXF_SINGULARITY_HOME_MOUNT : true
101- run : nextflow run ./${{ env. REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env .REPO_BRANCH }}) -profile test,singularity --outdir ./results
113+ run : nextflow run ./${{ needs.configure.outputs. REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ needs.configure.outputs .REPO_BRANCH }}) -profile test,singularity --outdir ./results
102114
103115 - name : Count the downloaded number of container images
104116 id : count_afterwards
105117 run : |
106118 image_count=$(ls -1 ./singularity_container_images | wc -l | xargs)
107119 echo "Post-pipeline run container image count: $image_count"
108- echo "IMAGE_COUNT_AFTER=$image_count" >> ${GITHUB_ENV}
120+ echo "IMAGE_COUNT_AFTER=$image_count" >> "$GITHUB_OUTPUT"
109121
110122 - name : Compare container image counts
111123 run : |
112- if [ "${{ env. IMAGE_COUNT_INITIAL }}" -ne "${{ env .IMAGE_COUNT_AFTER }}" ]; then
113- initial_count=${{ env .IMAGE_COUNT_INITIAL }}
114- final_count=${{ env .IMAGE_COUNT_AFTER }}
124+ if [ "${{ steps.count_initial.outputs. IMAGE_COUNT_INITIAL }}" -ne "${{ steps.count_afterwards.outputs .IMAGE_COUNT_AFTER }}" ]; then
125+ initial_count=${{ steps.count_initial.outputs .IMAGE_COUNT_INITIAL }}
126+ final_count=${{ steps.count_afterwards.outputs .IMAGE_COUNT_AFTER }}
115127 difference=$((final_count - initial_count))
116128 echo "$difference additional container images were \n downloaded at runtime . The pipeline has no support for offline runs!"
117- tree ./singularity_container_images
129+ tree ./singularity_container_images > ./container_afterwards
130+ diff ./container_initial ./container_afterwards
118131 exit 1
119132 else
120133 echo "The pipeline can be downloaded successfully!"
0 commit comments