From ce0db16615336546d6683f5ec4da36b0b2316edb Mon Sep 17 00:00:00 2001 From: Felipe Marques de Almeida Date: Tue, 13 Feb 2024 11:15:15 +0000 Subject: [PATCH] update ci.yml for nf-test --- .github/workflows/ci.yml | 68 +++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8907caf..574c5fd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,39 +1,43 @@ -name: nf-core CI # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors +name: nf-core CI on: - push: - branches: - - dev pull_request: release: types: [published] + merge_group: + types: + - checks_requested + branches: + - master + - dev env: NXF_ANSI_LOG: false + NFTEST_VER: "0.8.1" concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" cancel-in-progress: true jobs: test: - name: Run pipeline with test data - # Only run on push if this is the nf-core dev branch (merged PRs) - if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/scrnaseq') }}" + name: ${{ matrix.profile }} NF ${{ matrix.NXF_VER }} + needs: [changes, define_nxf_versions] runs-on: ubuntu-latest strategy: + fail-fast: false matrix: NXF_VER: - "23.04.0" - "latest-everything" - profile: [ - "test,docker --aligner alevin", - "test,docker --aligner kallisto", - "test,docker --aligner star", - "test,docker --aligner cellranger", - # "test,docker --aligner cellrangerarc", // this currently lacks a suitable test profile, see issue https://github.com/nf-core/scrnaseq/issues/290 - # "test,docker --aligner universc", // this is broken, see issue https://github.com/nf-core/scrnaseq/issues/289 + profile: + [ + "tests/main_pipeline_alevin.test", + "tests/main_pipeline_cellranger.test", + "tests/main_pipeline_kallisto.test", + "tests/main_pipeline_star.test", ] + steps: - name: Free some space run: | @@ -41,6 +45,7 @@ jobs: sudo rm -rf /opt/ghc sudo rm -rf "/usr/local/share/boost" sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - name: Check out pipeline code uses: actions/checkout@v4 @@ -49,8 +54,33 @@ jobs: with: version: "${{ matrix.NXF_VER }}" - - name: Run pipeline with test data - # For example: adding multiple test runs with different parameters - # Remember that you can parallelise this by using strategy.matrix + - name: Cache nf-test installation + id: cache-software + uses: actions/cache@v3 + with: + path: | + /usr/local/bin/nf-test + /home/runner/.nf-test/nf-test.jar + key: ${{ runner.os }}-${{ env.NFTEST_VER }}-nftest + + - name: Install nf-test + if: steps.cache-software.outputs.cache-hit != 'true' + run: | + wget -qO- https://code.askimed.com/install/nf-test | bash + sudo mv nf-test /usr/local/bin/ + + - name: Run nf-test run: | - nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.profile }} --outdir ./results + nf-test test "${{ matrix.profile }}" --junitxml=test.xml + + - name: Output log on failure + if: failure() + run: | + sudo apt install bat > /dev/null + batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/meta/nextflow.log + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails + with: + report_paths: test.xml