|
1 | 1 | name: nf-core CI
|
2 | 2 | # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
|
3 | 3 | on:
|
4 |
| - push: |
| 4 | + pull_request: |
5 | 5 | branches:
|
6 | 6 | - dev
|
7 |
| - pull_request: |
| 7 | + - master |
8 | 8 | release:
|
9 | 9 | types: [published]
|
10 | 10 | workflow_dispatch:
|
11 | 11 |
|
12 | 12 | env:
|
| 13 | + NFT_DIFF: "pdiff" |
| 14 | + NFT_DIFF_ARGS: "--line-numbers --expand-tabs=2" |
| 15 | + NFT_VER: "0.9.2" |
| 16 | + NFT_WORKDIR: "~" |
13 | 17 | NXF_ANSI_LOG: false
|
| 18 | + NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity |
| 19 | + NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity |
14 | 20 |
|
15 | 21 | concurrency:
|
16 | 22 | group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
|
17 | 23 | cancel-in-progress: true
|
18 | 24 |
|
19 | 25 | jobs:
|
20 | 26 | test:
|
21 |
| - name: Run pipeline with test data |
| 27 | + name: "${{ matrix.NXF_VER }} | ${{ matrix.profile }} | ${{ matrix.shard }}/6" |
22 | 28 | # Only run on push if this is the nf-core dev branch (merged PRs)
|
23 |
| - if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/variantbenchmarking') }}" |
| 29 | + if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/demultiplex') }}" |
24 | 30 | runs-on: ubuntu-latest
|
25 | 31 | strategy:
|
| 32 | + fail-fast: false |
26 | 33 | matrix:
|
27 | 34 | NXF_VER:
|
28 | 35 | - "24.04.2"
|
29 |
| - - "latest-everything" |
| 36 | + - "latest-stable" |
| 37 | + profile: |
| 38 | + - "docker" |
| 39 | + - "singularity" |
| 40 | + isMaster: |
| 41 | + - ${{ github.base_ref == 'master' }} |
| 42 | + # Exclude conda and singularity on dev |
| 43 | + exclude: |
| 44 | + - isMaster: false |
| 45 | + profile: "conda" |
| 46 | + - isMaster: false |
| 47 | + profile: "singularity" |
| 48 | + shard: [1, 2, 3, 4, 5, 6] |
30 | 49 | steps:
|
31 | 50 | - name: Check out pipeline code
|
32 | 51 | uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
|
| 52 | + with: |
| 53 | + fetch-depth: 0 |
33 | 54 |
|
34 |
| - - name: Install Nextflow |
| 55 | + - name: Set up Nextflow |
35 | 56 | uses: nf-core/setup-nextflow@v2
|
36 | 57 | with:
|
37 | 58 | version: "${{ matrix.NXF_VER }}"
|
38 | 59 |
|
39 |
| - - name: Disk space cleanup |
40 |
| - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 |
| 60 | + - name: Set up Apptainer |
| 61 | + if: matrix.profile == 'singularity' |
| 62 | + uses: eWaterCycle/setup-apptainer@main |
| 63 | + |
| 64 | + - name: Set up Singularity |
| 65 | + if: matrix.profile == 'singularity' |
| 66 | + run: | |
| 67 | + mkdir -p $NXF_SINGULARITY_CACHEDIR |
| 68 | + mkdir -p $NXF_SINGULARITY_LIBRARYDIR |
| 69 | +
|
| 70 | + - name: Set up Miniconda |
| 71 | + if: matrix.profile == 'conda' |
| 72 | + uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3 |
| 73 | + with: |
| 74 | + miniconda-version: "latest" |
| 75 | + auto-update-conda: true |
| 76 | + conda-solver: libmamba |
| 77 | + channels: conda-forge,bioconda |
41 | 78 |
|
42 |
| - - name: Run pipeline with test data for germline analysis (docker) |
43 |
| - # TODO nf-core: You can customise CI pipeline run tests as required |
44 |
| - # For example: adding multiple test runs with different parameters |
45 |
| - # Remember that you can parallelise this by using strategy.matrix |
| 79 | + - name: Set up Conda |
| 80 | + if: matrix.profile == 'conda' |
46 | 81 | run: |
|
47 |
| - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results |
| 82 | + echo $(realpath $CONDA)/condabin >> $GITHUB_PATH |
| 83 | + echo $(realpath python) >> $GITHUB_PATH |
48 | 84 |
|
49 |
| - - name: Run pipeline with test data (singularity) |
50 |
| - # TODO nf-core: You can customise CI pipeline run tests as required |
| 85 | + - name: Clean up Disk space |
| 86 | + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 |
| 87 | + |
| 88 | + - uses: actions/setup-python@v4 |
| 89 | + with: |
| 90 | + python-version: "3.11" |
| 91 | + architecture: "x64" |
| 92 | + |
| 93 | + - name: Install pdiff to see diff between nf-test snapshots |
51 | 94 | run: |
|
52 |
| - nextflow run ${GITHUB_WORKSPACE} -profile test,singularity --outdir ./results |
53 |
| - if: "${{ github.base_ref == 'master' }}" |
| 95 | + python -m pip install --upgrade pip |
| 96 | + pip install pdiff |
54 | 97 |
|
55 |
| - - name: Run pipeline with test data (conda) |
56 |
| - # TODO nf-core: You can customise CI pipeline run tests as required |
| 98 | + - uses: nf-core/setup-nf-test@v1 |
| 99 | + with: |
| 100 | + version: ${{ env.NFT_VER }} |
| 101 | + |
| 102 | + - name: Run Tests (Shard ${{ matrix.shard }}/6) |
57 | 103 | run: |
|
58 |
| - nextflow run ${GITHUB_WORKSPACE} -profile test,conda --outdir ./results |
59 |
| - if: "${{ github.base_ref == 'master' }}" |
| 104 | + nf-test test \ |
| 105 | + --ci \ |
| 106 | + --shard ${{ matrix.shard }}/6 \ |
| 107 | + --changed-since HEAD^ \ |
| 108 | + --profile "+${{ matrix.profile }}" \ |
| 109 | + --filter pipeline \ |
| 110 | + --junitxml=test.xml |
| 111 | +
|
| 112 | + - name: Publish Test Report |
| 113 | + uses: mikepenz/action-junit-report@v3 |
| 114 | + if: always() # always run even if the previous step fails |
| 115 | + with: |
| 116 | + report_paths: test.xml |
| 117 | + annotate_only: true |
0 commit comments