|
| 1 | +name: Test successful pipeline download with 'nf-core download' |
| 2 | + |
| 3 | +# Run the workflow when: |
| 4 | +# - dispatched manually |
| 5 | +# - when a PR is opened or reopened to master branch |
| 6 | +# - the head branch of the pull request is updated, i.e. if fixes for a release are pushed last minute to dev. |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + testbranch: |
| 11 | + description: "The specific branch you wish to utilize for the test execution of nf-core download." |
| 12 | + required: true |
| 13 | + default: "dev" |
| 14 | + pull_request: |
| 15 | + types: |
| 16 | + - opened |
| 17 | + - edited |
| 18 | + - synchronize |
| 19 | + branches: |
| 20 | + - master |
| 21 | + pull_request_target: |
| 22 | + branches: |
| 23 | + - master |
| 24 | + |
| 25 | +env: |
| 26 | + NXF_ANSI_LOG: false |
| 27 | + |
| 28 | +jobs: |
| 29 | + download: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - name: Install Nextflow |
| 33 | + uses: nf-core/setup-nextflow@v2 |
| 34 | + |
| 35 | + - name: Disk space cleanup |
| 36 | + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 |
| 37 | + |
| 38 | + - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 |
| 39 | + with: |
| 40 | + python-version: "3.12" |
| 41 | + architecture: "x64" |
| 42 | + - uses: eWaterCycle/setup-singularity@931d4e31109e875b13309ae1d07c70ca8fbc8537 # v7 |
| 43 | + with: |
| 44 | + singularity-version: 3.8.3 |
| 45 | + |
| 46 | + - name: Install dependencies |
| 47 | + run: | |
| 48 | + python -m pip install --upgrade pip |
| 49 | + pip install git+https://github.com/nf-core/tools.git@dev |
| 50 | +
|
| 51 | + - name: Get the repository name and current branch set as environment variable |
| 52 | + 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} |
| 56 | +
|
| 57 | + - name: Download the pipeline |
| 58 | + env: |
| 59 | + NXF_SINGULARITY_CACHEDIR: ./ |
| 60 | + run: | |
| 61 | + nf-core download ${{ env.REPO_LOWERCASE }} \ |
| 62 | + --revision ${{ env.REPO_BRANCH }} \ |
| 63 | + --outdir ./${{ env.REPOTITLE_LOWERCASE }} \ |
| 64 | + --compress "none" \ |
| 65 | + --container-system 'singularity' \ |
| 66 | + --container-library "quay.io" -l "docker.io" -l "ghcr.io" \ |
| 67 | + --container-cache-utilisation 'amend' \ |
| 68 | + --download-configuration |
| 69 | +
|
| 70 | + - name: Inspect download |
| 71 | + run: tree ./${{ env.REPOTITLE_LOWERCASE }} |
| 72 | + |
| 73 | + - name: Run the downloaded pipeline (stub) |
| 74 | + id: stub_run_pipeline |
| 75 | + continue-on-error: true |
| 76 | + env: |
| 77 | + NXF_SINGULARITY_CACHEDIR: ./ |
| 78 | + 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 |
| 80 | + - name: Run the downloaded pipeline (stub run not supported) |
| 81 | + id: run_pipeline |
| 82 | + if: ${{ job.steps.stub_run_pipeline.status == failure() }} |
| 83 | + env: |
| 84 | + NXF_SINGULARITY_CACHEDIR: ./ |
| 85 | + NXF_SINGULARITY_HOME_MOUNT: true |
| 86 | + run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -profile test,singularity --outdir ./results |
0 commit comments