|
7 | 7 | pull_request:
|
8 | 8 | release:
|
9 | 9 | types: [published]
|
| 10 | + workflow_dispatch: |
10 | 11 |
|
11 | 12 | env:
|
| 13 | + NFT_DIFF: "pdiff" |
| 14 | + NFT_DIFF_ARGS: "--line-numbers --width 120 --expand-tabs=2" |
| 15 | + NFT_VER: "0.9.0" |
| 16 | + NFT_WORKDIR: "~" |
12 | 17 | NXF_ANSI_LOG: false
|
| 18 | + NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity |
| 19 | + NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity |
13 | 20 |
|
14 | 21 | concurrency:
|
15 | 22 | group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
|
16 | 23 | cancel-in-progress: true
|
17 | 24 |
|
18 | 25 | jobs:
|
19 | 26 | test:
|
20 |
| - name: Run pipeline with test data |
| 27 | + name: "Test ${{ matrix.filter }} | ${{ matrix.profile }} | ${{ matrix.NXF_VER }} | ${{ matrix.shard }}/5" |
21 | 28 | # Only run on push if this is the nf-core dev branch (merged PRs)
|
22 | 29 | if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnavar') }}"
|
23 | 30 | runs-on: ubuntu-latest
|
24 | 31 | strategy:
|
| 32 | + fail-fast: false |
25 | 33 | matrix:
|
26 | 34 | NXF_VER:
|
27 |
| - - "23.04.0" |
| 35 | + - "24.04.2" |
28 | 36 | - "latest-everything"
|
29 |
| - test: |
30 |
| - - "default" |
31 |
| - - "annotation" |
32 |
| - - "removeduplicates" |
33 |
| - - "skipbasecalib" |
34 |
| - - "bamcsiindex" |
| 37 | + filter: ["pipeline"] |
| 38 | + # filter: ["process", "workflow", "function", "pipeline"] |
| 39 | + profile: ["conda", "docker", "singularity"] |
| 40 | + shard: [1, 2, 3, 4] |
| 41 | + isMaster: |
| 42 | + - ${{ github.base_ref == 'master' }} |
| 43 | + exclude: |
| 44 | + - isMaster: false |
| 45 | + profile: "conda" |
| 46 | + - isMaster: false |
| 47 | + profile: "singularity" |
35 | 48 | steps:
|
36 | 49 | - name: Check out pipeline code
|
37 | 50 | uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
|
| 51 | + with: |
| 52 | + fetch-depth: 0 |
38 | 53 |
|
39 |
| - - name: Install Nextflow |
| 54 | + - name: Set up Nextflow |
40 | 55 | uses: nf-core/setup-nextflow@v2
|
41 | 56 | with:
|
42 | 57 | version: "${{ matrix.NXF_VER }}"
|
43 | 58 |
|
| 59 | + - name: Set up nf-test |
| 60 | + uses: nf-core/setup-nf-test@v1 |
| 61 | + with: |
| 62 | + version: ${{ env.NFT_VER }} |
| 63 | + |
| 64 | + - name: Set up Apptainer |
| 65 | + if: matrix.profile == 'singularity' |
| 66 | + uses: eWaterCycle/setup-apptainer@main |
| 67 | + |
| 68 | + - name: Set up Singularity |
| 69 | + if: matrix.profile == 'singularity' |
| 70 | + run: | |
| 71 | + mkdir -p $NXF_SINGULARITY_CACHEDIR |
| 72 | + mkdir -p $NXF_SINGULARITY_LIBRARYDIR |
| 73 | +
|
| 74 | + - name: Cache pdiff |
| 75 | + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 |
| 76 | + id: cache-pip-pdiff |
| 77 | + with: |
| 78 | + path: ~/.cache/pip |
| 79 | + key: ${{ runner.os }}-pip-pdiff |
| 80 | + |
| 81 | + - name: Set up pdiff to see diff between nf-test snapshots |
| 82 | + run: | |
| 83 | + python -m pip install --upgrade pip |
| 84 | + pip install pdiff cryptography |
| 85 | +
|
| 86 | + - name: Set up Miniconda |
| 87 | + if: matrix.profile == 'conda' |
| 88 | + uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3 |
| 89 | + with: |
| 90 | + miniconda-version: "latest" |
| 91 | + auto-update-conda: true |
| 92 | + conda-solver: libmamba |
| 93 | + channels: conda-forge,bioconda |
| 94 | + |
| 95 | + - name: Set up Conda |
| 96 | + if: matrix.profile == 'conda' |
| 97 | + run: | |
| 98 | + echo $(realpath $CONDA)/condabin >> $GITHUB_PATH |
| 99 | + echo $(realpath python) >> $GITHUB_PATH |
| 100 | +
|
44 | 101 | - name: Disk space cleanup
|
45 | 102 | uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
|
46 | 103 |
|
47 |
| - - name: Set up Python |
48 |
| - uses: actions/setup-python@v2 |
49 |
| - with: |
50 |
| - python-version: "3.x" |
| 104 | + - name: "Run tests | ${{ matrix.filter }}_${{ matrix.profile }} | ${{ matrix.shard }}/5" |
| 105 | + run: | |
| 106 | + nf-test test \ |
| 107 | + --ci \ |
| 108 | + --debug \ |
| 109 | + --verbose \ |
| 110 | + --junitxml="TEST-${{ matrix.filter }}_${{ matrix.profile }}_${{ matrix.shard }}.xml" \ |
| 111 | + --shard ${{ matrix.shard }}/5 \ |
| 112 | + --changed-since HEAD^ \ |
| 113 | + --follow-dependencies \ |
| 114 | + --profile "+${{ matrix.profile }}" \ |
| 115 | + --filter ${{ matrix.filter }} |
51 | 116 |
|
52 |
| - - name: Install dependencies |
53 |
| - run: python -m pip install --upgrade pip pytest-workflow |
| 117 | + - name: Publish Test Report |
| 118 | + uses: mikepenz/action-junit-report@v4 |
| 119 | + if: success() || failure() # always run even if the previous step fails |
| 120 | + with: |
| 121 | + report_paths: "TEST-*.xml" |
54 | 122 |
|
55 |
| - - name: Run pipeline with tests settings |
56 |
| - run: TMPDIR=~ PROFILE=docker pytest --tag ${{ matrix.test }} --symlink --kwdof --git-aware --color=yes |
| 123 | + - name: Clean up |
| 124 | + if: always() |
| 125 | + run: | |
| 126 | + sudo rm -rf /home/ubuntu/tests/ |
0 commit comments