From ac3680e9171d0e64e17cd9fd297c1d5df30b6dc3 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Wed, 1 May 2024 10:08:39 +0100 Subject: [PATCH 1/8] Copy in CI from fetchngs --- .github/workflows/ci.yml | 77 ++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index faa0742..3b1c9c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,22 @@ -name: nf-aggregate 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: pull_request: release: - types: - - published + types: [published] merge_group: types: - checks_requested branches: - master + - dev env: NXF_ANSI_LOG: false + NFT_VER: "0.8.4" + NFT_WORKDIR: "~" + NFT_DIFF: "pdiff" + NFT_DIFF_ARGS: "--line-numbers --expand-tabs=2" concurrency: group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" @@ -20,49 +24,61 @@ concurrency: jobs: changes: - name: Find tags to test + name: Check for changes runs-on: ubuntu-latest outputs: - tags: ${{ steps.get_tags.outputs.result }} + nf_test_files: ${{ steps.list.outputs.components }} steps: - uses: actions/checkout@v3 - - name: Combine all tags.yml files - id: get_username - run: find . -name "tags.yml" -not -path "./.github/*" -exec cat {} + > .github/tags.yml - - name: debug - run: cat .github/tags.yml - - name: Get tags using yq - id: get_tags - uses: mikefarah/yq@master with: - cmd: yq -e '. | keys | tojson' .github/tags.yml + fetch-depth: 0 + + - name: List nf-test files + id: list + uses: adamrtalbot/detect-nf-test-changes@v0.0.3 + with: + head: ${{ github.sha }} + base: origin/${{ github.base_ref }} + include: .github/include.yaml - nf-test: - name: nf-test ${{ matrix.tags }} ${{ matrix.profile }} nf-${{ matrix.NXF_VER }} + - name: print list of nf-test files + run: | + echo ${{ steps.list.outputs.components }} + + test: + name: ${{ matrix.nf_test_files }} ${{ matrix.profile }} NF-${{ matrix.NXF_VER }} needs: [changes] - if: needs.changes.outputs.tags != '[]' + if: needs.changes.outputs.nf_test_files != '[]' runs-on: ubuntu-latest - env: - TOWER_ACCESS_TOKEN: ${{ secrets.TOWER_ACCESS_TOKEN }} strategy: fail-fast: false matrix: NXF_VER: - - "23.10.0" - "latest-everything" - tags: ${{ fromJson(needs.changes.outputs.tags) }} + - "23.04" + nf_test_files: ["${{ fromJson(needs.changes.outputs.nf_test_files) }}"] profile: - "docker" steps: - name: Check out pipeline code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Nextflow - uses: nf-core/setup-nextflow@v1 + uses: nf-core/setup-nextflow@v2 with: version: "${{ matrix.NXF_VER }}" + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + architecture: "x64" + + - name: Install pdiff to see diff between nf-test snapshots + run: | + python -m pip install --upgrade pip + pip install pdiff + - name: Cache nf-test installation id: cache-software uses: actions/cache@v3 @@ -70,7 +86,7 @@ jobs: path: | /usr/local/bin/nf-test /home/runner/.nf-test/nf-test.jar - key: ${{ runner.os }}-${{ env.NFTEST_VER }}-nftest + key: ${{ runner.os }}-${{ env.NFT_VER }}-nftest - name: Install nf-test if: steps.cache-software.outputs.cache-hit != 'true' @@ -80,7 +96,12 @@ jobs: - name: Run nf-test run: | - nf-test test --tag ${{ matrix.tags }} --profile "test,${{ matrix.profile }}" --junitxml=test.xml --verbose + nf-test test --verbose ${{ matrix.nf_test_files }} --profile "+${{ matrix.profile }}" --junitxml=test.xml --tap=test.tap + + - uses: pcolby/tap-summary@v1 + with: + path: >- + test.tap - name: Output log on failure if: failure() @@ -96,11 +117,13 @@ jobs: confirm-pass: runs-on: ubuntu-latest - needs: [changes, nf-test] + needs: + - changes + - test if: always() steps: - name: All tests ok - if: ${{ success() || !contains(needs.*.result, 'failure') }} + if: ${{ !contains(needs.*.result, 'failure') }} run: exit 0 - name: One or more tests failed if: ${{ contains(needs.*.result, 'failure') }} From ee757cf6cf930c6179fb6cf5d22b5f2d2dce61bc Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Wed, 1 May 2024 10:11:40 +0100 Subject: [PATCH 2/8] Add include.yaml --- .github/include.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/include.yaml diff --git a/.github/include.yaml b/.github/include.yaml new file mode 100644 index 0000000..a3629f4 --- /dev/null +++ b/.github/include.yaml @@ -0,0 +1,10 @@ +".": + - ./.github/workflows/** + - ./nf-test.config + - ./nextflow.config +tests: + - ./assets/* + - ./bin/* + - ./conf/* + - ./main.nf + - ./nextflow_schema.json From dbcc41e960c06484b9f0d440f86295005ca54210 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Wed, 1 May 2024 10:23:31 +0100 Subject: [PATCH 3/8] Bump tower-cli --- modules/local/seqera_runs_dump/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/local/seqera_runs_dump/main.nf b/modules/local/seqera_runs_dump/main.nf index 1628beb..9a69300 100644 --- a/modules/local/seqera_runs_dump/main.nf +++ b/modules/local/seqera_runs_dump/main.nf @@ -2,8 +2,8 @@ include { getRunMetadata } from './functions' process SEQERA_RUNS_DUMP { tag "$meta.id" - conda 'tower-cli=0.9.0' - container 'seqeralabs/nf-aggregate:tower-cli-0.9.0--2cb0f2e9d85d026b' + conda 'tower-cli=0.9.2' + container 'seqeralabs/nf-aggregate:tower-cli-0.9.2--hdfd78af_1' input: val meta From 0389e614cd688dac1c156d0fc8b0420583c42090 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Fri, 3 May 2024 08:23:18 +0000 Subject: [PATCH 4/8] Older nf won't work --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b1c9c6..ce46484 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,6 @@ jobs: matrix: NXF_VER: - "latest-everything" - - "23.04" nf_test_files: ["${{ fromJson(needs.changes.outputs.nf_test_files) }}"] profile: - "docker" From 9111f97b60c82876a8d5d602f24fa14dc71cbfcf Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Fri, 3 May 2024 08:36:25 +0000 Subject: [PATCH 5/8] Fix up tests for utils_nf_aggregate --- subworkflows/local/utils_nf_aggregate/tests/main.nf.test | 6 ++++-- workflows/nf_aggregate/tests/main.nf.test.snap | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/subworkflows/local/utils_nf_aggregate/tests/main.nf.test b/subworkflows/local/utils_nf_aggregate/tests/main.nf.test index ecc46f5..f4777de 100644 --- a/subworkflows/local/utils_nf_aggregate/tests/main.nf.test +++ b/subworkflows/local/utils_nf_aggregate/tests/main.nf.test @@ -9,16 +9,18 @@ nextflow_workflow { stage { symlink "nextflow_schema.json" - symlink "workflows/nf_aggregate/assets/test_run_ids.csv" } test("Should run without failures") { when { + params { + input = "${projectDir}/workflows/nf_aggregate/assets/test_run_ids.csv" + } workflow { """ // define inputs of the workflow here. Example: - // input[0] = file("test-file.txt") + // input[0] = file("test_run_ids.csv") """ } } diff --git a/workflows/nf_aggregate/tests/main.nf.test.snap b/workflows/nf_aggregate/tests/main.nf.test.snap index 6baffb1..3709bad 100644 --- a/workflows/nf_aggregate/tests/main.nf.test.snap +++ b/workflows/nf_aggregate/tests/main.nf.test.snap @@ -10,6 +10,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-05-02T13:45:38.806631609" + "timestamp": "2024-05-03T08:19:43.740440752" } } \ No newline at end of file From 946bffdd5127d61fd808d3dc6c10d6e9d0042fb7 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Fri, 3 May 2024 08:50:57 +0000 Subject: [PATCH 6/8] Revert "Fix up tests for utils_nf_aggregate" This reverts commit 9111f97b60c82876a8d5d602f24fa14dc71cbfcf. --- subworkflows/local/utils_nf_aggregate/tests/main.nf.test | 6 ++---- workflows/nf_aggregate/tests/main.nf.test.snap | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/subworkflows/local/utils_nf_aggregate/tests/main.nf.test b/subworkflows/local/utils_nf_aggregate/tests/main.nf.test index f4777de..ecc46f5 100644 --- a/subworkflows/local/utils_nf_aggregate/tests/main.nf.test +++ b/subworkflows/local/utils_nf_aggregate/tests/main.nf.test @@ -9,18 +9,16 @@ nextflow_workflow { stage { symlink "nextflow_schema.json" + symlink "workflows/nf_aggregate/assets/test_run_ids.csv" } test("Should run without failures") { when { - params { - input = "${projectDir}/workflows/nf_aggregate/assets/test_run_ids.csv" - } workflow { """ // define inputs of the workflow here. Example: - // input[0] = file("test_run_ids.csv") + // input[0] = file("test-file.txt") """ } } diff --git a/workflows/nf_aggregate/tests/main.nf.test.snap b/workflows/nf_aggregate/tests/main.nf.test.snap index 3709bad..6baffb1 100644 --- a/workflows/nf_aggregate/tests/main.nf.test.snap +++ b/workflows/nf_aggregate/tests/main.nf.test.snap @@ -10,6 +10,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-05-03T08:19:43.740440752" + "timestamp": "2024-05-02T13:45:38.806631609" } } \ No newline at end of file From 8de332df68aea8a5842b3c98a41adfb2783f5455 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Fri, 3 May 2024 08:51:56 +0000 Subject: [PATCH 7/8] Activate test profile for nf-test --- nf-test.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf-test.config b/nf-test.config index c7fed01..97ad11b 100644 --- a/nf-test.config +++ b/nf-test.config @@ -9,5 +9,5 @@ config { configFile "tests/nextflow.config" // run all test with the defined docker profile from the main nextflow.config - profile "" + profile "test" } From deebe24d98704fcc6b250a54698dcde415ecad45 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Fri, 3 May 2024 08:57:38 +0000 Subject: [PATCH 8/8] Add token to env --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce46484..78f57e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ env: NFT_WORKDIR: "~" NFT_DIFF: "pdiff" NFT_DIFF_ARGS: "--line-numbers --expand-tabs=2" + TOWER_ACCESS_TOKEN: ${{ secrets.TOWER_ACCESS_TOKEN }} concurrency: group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"