From ba6b661e6866b427a0531b5a193491bd7ee0ed7a Mon Sep 17 00:00:00 2001 From: maxulysse Date: Thu, 10 Oct 2024 16:22:05 +0200 Subject: [PATCH] fix GHA --- .../.github/workflows/ci.yml | 61 ++++++++++++++++--- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/nf_core/pipeline-template/.github/workflows/ci.yml b/nf_core/pipeline-template/.github/workflows/ci.yml index cddac0d45..7fc18a245 100644 --- a/nf_core/pipeline-template/.github/workflows/ci.yml +++ b/nf_core/pipeline-template/.github/workflows/ci.yml @@ -11,26 +11,44 @@ on: env: NXF_ANSI_LOG: false + NXF_SINGULARITY_CACHEDIR: {% raw %}${{ github.workspace }}{% endraw %}/.singularity + NXF_SINGULARITY_LIBRARYDIR: {% raw %}${{ github.workspace }}{% endraw %}/.singularity concurrency: - group: "{% raw %}${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}{% endraw %}" + group: "{% raw %}${{ github.workflow }}{% endraw %}-{% raw %}${{ github.event.pull_request.number || github.ref }}{% endraw %}" cancel-in-progress: true jobs: test: - name: Run pipeline with test data + name: "Run pipeline with test data ({% raw %}${{ matrix.NXF_VER }}{% endraw %} | {% raw %}${{ matrix.test }}{% endraw %} | {% raw %}${{ matrix.profile }}{% endraw %})" # Only run on push if this is the nf-core dev branch (merged PRs) - if: "{% raw %}${{{% endraw %} github.event_name != 'push' || (github.event_name == 'push' && github.repository == '{{ name }}') {% raw %}}}{% endraw %}" + if: "{% raw %}${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/bamtofastq') }}{% endraw %}" runs-on: ubuntu-latest strategy: matrix: NXF_VER: - "24.04.2" - "latest-everything" - engine: + profile: - "conda" - "docker" - "singularity" + test: + - "test" + - "test_cram" + - "test_chr" + - "test_no_bai" + - "test_no_crai" + - "test_no_stats" + - "test_no_qc" + - "test_collate_fast" + isMaster: + - {% raw %}${{ github.base_ref == 'master' }}{% endraw %} + exclude: + - isMaster: false + profile: "conda" + - isMaster: false + profile: "singularity" steps: - name: Check out pipeline code uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 @@ -40,13 +58,36 @@ jobs: with: version: "{% raw %}${{ matrix.NXF_VER }}{% endraw %}" + - name: Setup apptainer + if: matrix.profile == 'singularity' + uses: eWaterCycle/setup-apptainer@main + + - name: Set up Singularity + if: matrix.profile == 'singularity' + run: | + mkdir -p $NXF_SINGULARITY_CACHEDIR + mkdir -p $NXF_SINGULARITY_LIBRARYDIR + + - name: Set up miniconda + if: matrix.profile == 'conda' + uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3 + with: + miniconda-version: "latest" + auto-update-conda: true + channels: conda-forge,bioconda + + - name: Conda setup + if: matrix.profile == 'conda' + run: | + conda clean -a + conda install -n base conda-libmamba-solver + conda config --set solver libmamba + echo $(realpath $CONDA)/condabin >> $GITHUB_PATH + echo $(realpath python) >> $GITHUB_PATH + - name: Disk space cleanup uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - - name: "Run pipeline with test data {% raw %}${{ matrix.NXF_VER }}{% endraw %} | {% raw %}${{ matrix.engine }}{% endraw %}" - # TODO nf-core: You can customise CI pipeline run tests as required - # For example: adding multiple test runs with different parameters - # Remember that you can parallelise this by using strategy.matrix + - name: " Run pipeline with test data {% raw %}${{ matrix.NXF_VER }}{% endraw %} | {% raw %}${{ matrix.test }}{% endraw %} | {% raw %}${{ matrix.profile }}{% endraw %}" run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,{% raw %}${{ matrix.engine }}{% endraw %} --outdir ./results - if: "!{% raw %}${{ github.base_ref == 'master' }}{% endraw %} || {% raw %}${{ matrix.engine == 'docker' }}{% endraw %}" + nextflow run ${GITHUB_WORKSPACE} -profile {% raw %}${{ matrix.test }}{% endraw %},{% raw %}${{ matrix.profile }}{% endraw %} --outdir ./results