|
| 1 | +name: "Create and lint nf-core pipeline" |
| 2 | +description: "Create and lint nf-core pipeline" |
| 3 | +inputs: |
| 4 | + NXF_VER: |
| 5 | + description: "Nextflow version" |
| 6 | + required: true |
| 7 | + |
| 8 | +runs: |
| 9 | + using: "composite" |
| 10 | + steps: |
| 11 | + - name: go to subdirectory and change nextflow workdir |
| 12 | + shell: bash |
| 13 | + run: | |
| 14 | + mkdir -p create-lint-wf |
| 15 | + cd create-lint-wf |
| 16 | + export NXF_WORK=$(pwd) |
| 17 | +
|
| 18 | + - name: Install Nextflow |
| 19 | + uses: nf-core/setup-nextflow@v2 |
| 20 | + with: |
| 21 | + version: ${{ matrix.NXF_VER }} |
| 22 | + |
| 23 | + # Build a pipeline from the template |
| 24 | + - name: nf-core create |
| 25 | + shell: bash |
| 26 | + run: | |
| 27 | + mkdir -p create-lint-wf && cd create-lint-wf |
| 28 | + export NXF_WORK=$(pwd) |
| 29 | + nf-core --log-file log.txt pipelines create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" |
| 30 | +
|
| 31 | + # Try syncing it before we change anything |
| 32 | + - name: nf-core pipelines sync |
| 33 | + shell: bash |
| 34 | + run: nf-core --log-file log.txt pipelines sync --dir nf-core-testpipeline/ |
| 35 | + working-directory: create-lint-wf |
| 36 | + |
| 37 | + # Run code style linting |
| 38 | + - name: run pre-commit |
| 39 | + shell: bash |
| 40 | + run: pre-commit run --all-files |
| 41 | + working-directory: create-lint-wf |
| 42 | + |
| 43 | + # Update modules to the latest version |
| 44 | + - name: nf-core modules update |
| 45 | + shell: bash |
| 46 | + run: nf-core --log-file log.txt modules update --dir nf-core-testpipeline --all --no-preview |
| 47 | + working-directory: create-lint-wf |
| 48 | + |
| 49 | + # Remove TODO statements |
| 50 | + - name: remove TODO |
| 51 | + shell: bash |
| 52 | + run: find nf-core-testpipeline -type f -exec sed -i '/TODO nf-core:/d' {} \; |
| 53 | + working-directory: create-lint-wf |
| 54 | + |
| 55 | + # Uncomment includeConfig statement |
| 56 | + - name: uncomment include config |
| 57 | + shell: bash |
| 58 | + run: find nf-core-testpipeline -type f -exec sed -i 's/\/\/ includeConfig/includeConfig/' {} \; |
| 59 | + working-directory: create-lint-wf |
| 60 | + |
| 61 | + # Replace zenodo.XXXXXX to pass readme linting |
| 62 | + - name: replace zenodo.XXXXXX |
| 63 | + shell: bash |
| 64 | + run: find nf-core-testpipeline -type f -exec sed -i 's/zenodo.XXXXXX/zenodo.123456/g' {} \; |
| 65 | + working-directory: create-lint-wf |
| 66 | + |
| 67 | + # Add empty ro-crate file |
| 68 | + - name: add empty ro-crate file |
| 69 | + shell: bash |
| 70 | + run: touch nf-core-testpipeline/ro-crate-metadata.json |
| 71 | + working-directory: create-lint-wf |
| 72 | + |
| 73 | + # Run nf-core pipelines linting |
| 74 | + - name: nf-core pipelines lint |
| 75 | + shell: bash |
| 76 | + run: nf-core --verbose --log-file log.txt --hide-progress pipelines lint --dir nf-core-testpipeline --fail-ignored --fail-warned |
| 77 | + working-directory: create-lint-wf |
| 78 | + |
| 79 | + - name: nf-core pipelines bump-version to release |
| 80 | + shell: bash |
| 81 | + run: nf-core --log-file log.txt pipelines bump-version --dir nf-core-testpipeline/ 1.1 |
| 82 | + working-directory: create-lint-wf |
| 83 | + |
| 84 | + - name: nf-core pipelines lint in release mode |
| 85 | + shell: bash |
| 86 | + run: nf-core --log-file log.txt --hide-progress pipelines lint --dir nf-core-testpipeline --fail-ignored --fail-warned --release |
| 87 | + working-directory: create-lint-wf |
| 88 | + |
| 89 | + - name: Upload log file artifact |
| 90 | + if: ${{ always() }} |
| 91 | + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 |
| 92 | + with: |
| 93 | + name: nf-core-log-file-${{ matrix.NXF_VER }} |
| 94 | + path: create-lint-wf/log.txt |
| 95 | + |
| 96 | + - name: nf-core modules install |
| 97 | + shell: bash |
| 98 | + run: nf-core --log-file log.txt modules install fastqc --dir nf-core-testpipeline/ --force |
| 99 | + working-directory: create-lint-wf |
| 100 | + |
| 101 | + - name: nf-core modules install gitlab |
| 102 | + shell: bash |
| 103 | + run: nf-core --log-file log.txt modules --git-remote https://gitlab.com/nf-core/modules-test.git --branch branch-tester install fastp --dir nf-core-testpipeline/ |
| 104 | + working-directory: create-lint-wf |
| 105 | + |
| 106 | + - name: nf-core modules list local |
| 107 | + shell: bash |
| 108 | + run: nf-core --log-file log.txt modules list local --dir nf-core-testpipeline/ |
| 109 | + working-directory: create-lint-wf |
| 110 | + |
| 111 | + - name: nf-core modules list remote |
| 112 | + shell: bash |
| 113 | + run: nf-core --log-file log.txt modules list remote |
| 114 | + working-directory: create-lint-wf |
| 115 | + |
| 116 | + - name: nf-core modules list remote gitlab |
| 117 | + shell: bash |
| 118 | + run: nf-core --log-file log.txt modules --git-remote https://gitlab.com/nf-core/modules-test.git list remote |
| 119 | + working-directory: create-lint-wf |
0 commit comments