|
1 | | -name: Test successful pipeline download with 'nf-core download' |
| 1 | +name: Test successful pipeline download with 'nf-core pipelines download' |
2 | 2 |
|
3 | 3 | # Run the workflow when: |
4 | 4 | # - dispatched manually |
5 | | -# - when a PR is opened or reopened to master branch |
| 5 | +# - when a PR is opened or reopened to main/master branch |
6 | 6 | # - the head branch of the pull request is updated, i.e. if fixes for a release are pushed last minute to dev. |
7 | 7 | on: |
8 | 8 | workflow_dispatch: |
9 | 9 | inputs: |
10 | 10 | testbranch: |
11 | | - description: "The specific branch you wish to utilize for the test execution of nf-core download." |
| 11 | + description: "The specific branch you wish to utilize for the test execution of nf-core pipelines download." |
12 | 12 | required: true |
13 | 13 | default: "dev" |
14 | 14 | pull_request: |
15 | | - types: |
16 | | - - opened |
17 | | - - edited |
18 | | - - synchronize |
19 | | - branches: |
20 | | - - master |
21 | | - pull_request_target: |
22 | 15 | branches: |
| 16 | + - main |
23 | 17 | - master |
24 | 18 |
|
25 | 19 | env: |
26 | 20 | NXF_ANSI_LOG: false |
27 | 21 |
|
28 | 22 | jobs: |
| 23 | + configure: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + outputs: |
| 26 | + REPO_LOWERCASE: ${{ steps.get_repo_properties.outputs.REPO_LOWERCASE }} |
| 27 | + REPOTITLE_LOWERCASE: ${{ steps.get_repo_properties.outputs.REPOTITLE_LOWERCASE }} |
| 28 | + REPO_BRANCH: ${{ steps.get_repo_properties.outputs.REPO_BRANCH }} |
| 29 | + steps: |
| 30 | + - name: Get the repository name and current branch |
| 31 | + id: get_repo_properties |
| 32 | + run: | |
| 33 | + echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT" |
| 34 | + echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> "$GITHUB_OUTPUT" |
| 35 | + echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> "$GITHUB_OUTPUT" |
| 36 | +
|
29 | 37 | download: |
30 | 38 | runs-on: ubuntu-latest |
| 39 | + needs: configure |
31 | 40 | steps: |
32 | 41 | - name: Install Nextflow |
33 | 42 | uses: nf-core/setup-nextflow@v2 |
34 | 43 |
|
35 | 44 | - name: Disk space cleanup |
36 | 45 | uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 |
37 | 46 |
|
38 | | - - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 |
| 47 | + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 |
39 | 48 | with: |
40 | | - python-version: "3.12" |
| 49 | + python-version: "3.13" |
41 | 50 | architecture: "x64" |
42 | | - - uses: eWaterCycle/setup-singularity@931d4e31109e875b13309ae1d07c70ca8fbc8537 # v7 |
| 51 | + |
| 52 | + - name: Setup Apptainer |
| 53 | + uses: eWaterCycle/setup-apptainer@4bb22c52d4f63406c49e94c804632975787312b3 # v2.0.0 |
43 | 54 | with: |
44 | | - singularity-version: 3.8.3 |
| 55 | + apptainer-version: 1.3.4 |
45 | 56 |
|
46 | 57 | - name: Install dependencies |
47 | 58 | run: | |
48 | 59 | python -m pip install --upgrade pip |
49 | 60 | pip install git+https://github.com/nf-core/tools.git@dev |
50 | 61 |
|
51 | | - - name: Get the repository name and current branch set as environment variable |
| 62 | + - name: Make a cache directory for the container images |
52 | 63 | run: | |
53 | | - echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} |
54 | | - echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV} |
55 | | - echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> ${GITHUB_ENV} |
| 64 | + mkdir -p ./singularity_container_images |
56 | 65 |
|
57 | 66 | - name: Download the pipeline |
58 | 67 | env: |
59 | | - NXF_SINGULARITY_CACHEDIR: ./ |
| 68 | + NXF_SINGULARITY_CACHEDIR: ./singularity_container_images |
60 | 69 | run: | |
61 | | - nf-core download ${{ env.REPO_LOWERCASE }} \ |
62 | | - --revision ${{ env.REPO_BRANCH }} \ |
63 | | - --outdir ./${{ env.REPOTITLE_LOWERCASE }} \ |
| 70 | + nf-core pipelines download ${{ needs.configure.outputs.REPO_LOWERCASE }} \ |
| 71 | + --revision ${{ needs.configure.outputs.REPO_BRANCH }} \ |
| 72 | + --outdir ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }} \ |
64 | 73 | --compress "none" \ |
65 | 74 | --container-system 'singularity' \ |
66 | | - --container-library "quay.io" -l "docker.io" -l "ghcr.io" \ |
| 75 | + --container-library "quay.io" -l "docker.io" -l "community.wave.seqera.io/library/" -l "ghcr.io" \ |
67 | 76 | --container-cache-utilisation 'amend' \ |
68 | | - --download-configuration |
| 77 | + --download-configuration 'yes' |
69 | 78 |
|
70 | 79 | - name: Inspect download |
71 | | - run: tree ./${{ env.REPOTITLE_LOWERCASE }} |
| 80 | + run: tree ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }} |
| 81 | + |
| 82 | + - name: Inspect container images |
| 83 | + run: tree ./singularity_container_images | tee ./container_initial |
| 84 | + |
| 85 | + - name: Count the downloaded number of container images |
| 86 | + id: count_initial |
| 87 | + run: | |
| 88 | + image_count=$(ls -1 ./singularity_container_images | wc -l | xargs) |
| 89 | + echo "Initial container image count: $image_count" |
| 90 | + echo "IMAGE_COUNT_INITIAL=$image_count" >> "$GITHUB_OUTPUT" |
| 91 | +
|
| 92 | + - name: Count the downloaded number of container images |
| 93 | + id: count_afterwards |
| 94 | + run: | |
| 95 | + image_count=$(ls -1 ./singularity_container_images | wc -l | xargs) |
| 96 | + echo "Post-pipeline run container image count: $image_count" |
| 97 | + echo "IMAGE_COUNT_AFTER=$image_count" >> "$GITHUB_OUTPUT" |
| 98 | +
|
| 99 | + - name: Compare container image counts |
| 100 | + id: count_comparison |
| 101 | + run: | |
| 102 | + if [ "${{ steps.count_initial.outputs.IMAGE_COUNT_INITIAL }}" -ne "${{ steps.count_afterwards.outputs.IMAGE_COUNT_AFTER }}" ]; then |
| 103 | + initial_count=${{ steps.count_initial.outputs.IMAGE_COUNT_INITIAL }} |
| 104 | + final_count=${{ steps.count_afterwards.outputs.IMAGE_COUNT_AFTER }} |
| 105 | + difference=$((final_count - initial_count)) |
| 106 | + echo "$difference additional container images were \n downloaded at runtime . The pipeline has no support for offline runs!" |
| 107 | + tree ./singularity_container_images > ./container_afterwards |
| 108 | + diff ./container_initial ./container_afterwards |
| 109 | + exit 1 |
| 110 | + else |
| 111 | + echo "The pipeline can be downloaded successfully!" |
| 112 | + fi |
72 | 113 |
|
73 | 114 | - name: Run the downloaded pipeline (stub) |
74 | 115 | id: stub_run_pipeline |
75 | 116 | continue-on-error: true |
76 | 117 | env: |
77 | | - NXF_SINGULARITY_CACHEDIR: ./ |
| 118 | + NXF_SINGULARITY_CACHEDIR: ./singularity_container_images |
78 | 119 | NXF_SINGULARITY_HOME_MOUNT: true |
79 | | - run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results |
| 120 | + run: nextflow run ./${{needs.configure.outputs.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ needs.configure.outputs.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results |
80 | 121 | - name: Run the downloaded pipeline (stub run not supported) |
81 | 122 | id: run_pipeline |
82 | | - if: ${{ job.steps.stub_run_pipeline.status == failure() }} |
| 123 | + if: ${{ steps.stub_run_pipeline.outcome == 'failure' }} |
83 | 124 | env: |
84 | | - NXF_SINGULARITY_CACHEDIR: ./ |
| 125 | + NXF_SINGULARITY_CACHEDIR: ./singularity_container_images |
85 | 126 | NXF_SINGULARITY_HOME_MOUNT: true |
86 | | - run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -profile test,singularity --outdir ./results |
| 127 | + run: nextflow run ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ needs.configure.outputs.REPO_BRANCH }}) -profile test,singularity --outdir ./results |
| 128 | + |
| 129 | + - name: Upload Nextflow logfile for debugging purposes |
| 130 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 131 | + with: |
| 132 | + name: nextflow_logfile.txt |
| 133 | + path: .nextflow.log* |
| 134 | + include-hidden-files: true |
0 commit comments