From 23295ac46bc65ea2c2c9381e6f6617bb3161b305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20H=C3=B6rtenhuber?= Date: Thu, 30 Nov 2023 15:25:00 +0100 Subject: [PATCH 001/117] Parallelize pytest (#1) --- .github/workflows/create-lint-wf.yml | 2 +- .github/workflows/lint-code.yml | 10 +-- .github/workflows/push_dockerhub_dev.yml | 2 +- .github/workflows/pytest.yml | 84 ++++++++++++++++++------ .github/workflows/tools-api-docs-dev.yml | 2 +- 5 files changed, 71 insertions(+), 29 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index a3941f3ce1..152421b827 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -17,7 +17,7 @@ env: jobs: MakeTestWorkflow: - runs-on: self-hosted + runs-on: ubuntu-latest env: NXF_ANSI_LOG: false strategy: diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index 168fac653c..5f053eb007 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -14,7 +14,7 @@ concurrency: jobs: EditorConfig: - runs-on: ["self-hosted"] + runs-on: ["ubuntu-latest"] steps: - uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: run: editorconfig-checker -exclude README.md $(git ls-files | grep -v 'test\|.py\|md\|json\|yml\|yaml\|html\|css\|Makefile') Prettier: - runs-on: ["self-hosted"] + runs-on: ["ubuntu-latest"] steps: - uses: actions/checkout@v4 @@ -45,7 +45,7 @@ jobs: run: prettier --check ${GITHUB_WORKSPACE} PythonBlack: - runs-on: ["self-hosted"] + runs-on: ["ubuntu-latest"] steps: - uses: actions/checkout@v4 @@ -75,7 +75,7 @@ jobs: allow-repeats: false isort: - runs-on: ["self-hosted"] + runs-on: ["ubuntu-latest"] steps: - name: Check out source-code repository uses: actions/checkout@v4 @@ -91,7 +91,7 @@ jobs: requirementsFiles: "requirements.txt requirements-dev.txt" static-type-check: - runs-on: ["self-hosted"] + runs-on: ["ubuntu-latest"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 diff --git a/.github/workflows/push_dockerhub_dev.yml b/.github/workflows/push_dockerhub_dev.yml index 1230bfc9d3..169a917d83 100644 --- a/.github/workflows/push_dockerhub_dev.yml +++ b/.github/workflows/push_dockerhub_dev.yml @@ -13,7 +13,7 @@ concurrency: jobs: push_dockerhub: name: Push new Docker image to Docker Hub (dev) - runs-on: self-hosted + runs-on: ubuntu-latest # Only run for the nf-core repo, for releases and merged PRs if: ${{ github.repository == 'nf-core/tools' }} env: diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 9f8172a3be..3abbf8ef29 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -14,8 +14,9 @@ on: - "CHANGELOG.md" release: types: [published] + workflow_dispatch: -# Cancel if a newer run is started +# Cancel if a newer run with the same workflow name is queued concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -39,32 +40,42 @@ jobs: id: conditions run: echo "run-tests=${{ github.ref == 'refs/heads/master' || (matrix.runner == 'ubuntu-20.04' && matrix.python-version == '3.8') }}" >> $GITHUB_ENV - - name: Check out source-code repository - uses: actions/checkout@v4 - if: ${{ env.run-tests == 'true' }} - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - if: ${{ env.run-tests == 'true' }} outputs: python-version: ${{ matrix.python-version }} runner: ${{ matrix.runner }} run-tests: ${{ env.run-tests }} + # create a test matrix based on all python files in /tests + list_tests: + name: Get test file matrix + needs: setup + if: ${{ needs.setup.outputs.run-tests == 'true' }} + runs-on: ${{ needs.setup.outputs.runner }} + outputs: + tests: ${{ env.tests }} + steps: + - uses: actions/checkout@v4 + name: Check out source-code repository + + - name: List tests + id: list_tests + run: + | # get all python files in /tests except __init__.py and also all subdirectories and remove trailing commas + echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV + test: name: Test with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} - needs: setup + needs: [setup, list_tests] if: ${{ needs.setup.outputs.run-tests == 'true' }} runs-on: ${{ needs.setup.outputs.runner }} + strategy: + matrix: ${{ fromJson(needs.list_tests.outputs.tests) }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 name: Check out source-code repository - name: Set up Python ${{ needs.setup.outputs.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ needs.setup.outputs.python-version }} cache: "pip" @@ -87,8 +98,6 @@ jobs: - name: Install Nextflow uses: nf-core/setup-nextflow@v1 - with: - version: "latest-everything" - name: Cache nf-test installation id: cache-software @@ -106,10 +115,43 @@ jobs: sudo mv nf-test /usr/local/bin/ - name: Test with pytest - run: python3 -m pytest tests/ --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core + run: | + python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core || exit_code=$? + # don't fail if no tests were collected, e.g. for test_licence.py + if [ "${exit_code}" -eq 5 ]; then + echo "No tests were collected" + exit 0 + elif [ "${exit_code}" -ne 0 ]; then + echo "Tests failed with exit code ${exit_code}" + exit 1 + fi + + - name: Upload coverage + uses: actions/upload-artifact@v3 + with: + name: coverage${{ matrix.test }} + path: .coverage - - uses: codecov/codecov-action@v1 - name: Upload code coverage report + coverage: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.9 + uses: actions/setup-python@v4 with: - if: success() - token: ${{ secrets.CODECOV_TOKEN }} + python-version: 3.12 + cache: "pip" + - name: Install deps + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Download all artifacts + # Downloads coverage1, coverage2, etc. + uses: actions/download-artifact@v3 + - name: Run coverage + run: | + coverage combine coverage*/.coverage* + coverage report + coverage xml + - uses: codecov/codecov-action@v3 diff --git a/.github/workflows/tools-api-docs-dev.yml b/.github/workflows/tools-api-docs-dev.yml index f6106bd8b5..7de8913e03 100644 --- a/.github/workflows/tools-api-docs-dev.yml +++ b/.github/workflows/tools-api-docs-dev.yml @@ -20,7 +20,7 @@ concurrency: jobs: api-docs: name: Build & push Sphinx API docs - runs-on: self-hosted + runs-on: ubuntu-latest steps: - name: Check out source-code repository From 34285cf8903eb20ac7a1346ad6a93cb42037a992 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 30 Nov 2023 16:20:05 +0100 Subject: [PATCH 002/117] use PR to test aws runners --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3abbf8ef29..d48cc381cc 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -26,7 +26,7 @@ env: jobs: setup: - runs-on: ["ubuntu-latest"] + runs-on: ["self-hosted"] strategy: matrix: python-version: ["3.8", "3.12"] From 7cfb0ae4e8a924aa8ac15aa83e1d73ed69c177f8 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 30 Nov 2023 17:42:48 +0100 Subject: [PATCH 003/117] fix coverage step --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d48cc381cc..12647f1bc5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -145,7 +145,7 @@ jobs: - name: Install deps run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install -r requirements-dev.txt - name: Download all artifacts # Downloads coverage1, coverage2, etc. uses: actions/download-artifact@v3 From 1a8d7f6d747c64910adf3522c3c8f16745175ac3 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 30 Nov 2023 18:51:31 +0100 Subject: [PATCH 004/117] try self-hosted again --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 12647f1bc5..46385cfd29 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -67,7 +67,7 @@ jobs: name: Test with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} needs: [setup, list_tests] if: ${{ needs.setup.outputs.run-tests == 'true' }} - runs-on: ${{ needs.setup.outputs.runner }} + runs-on: "self-hosted" strategy: matrix: ${{ fromJson(needs.list_tests.outputs.tests) }} steps: From 8e4554d28f8238cbb947c1480aa0b83c165dc016 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 07:28:40 +0100 Subject: [PATCH 005/117] smaller naming changes --- .github/workflows/pytest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 46385cfd29..d5b89cd238 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -32,8 +32,8 @@ jobs: python-version: ["3.8", "3.12"] runner: ["ubuntu-latest"] include: - - runner: "ubuntu-20.04" - python-version: "3.8" + - python-version: "3.8" + runner: "ubuntu-20.04" steps: - name: Check conditions @@ -64,7 +64,7 @@ jobs: echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV test: - name: Test with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} + name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} needs: [setup, list_tests] if: ${{ needs.setup.outputs.run-tests == 'true' }} runs-on: "self-hosted" From 3b6909493c8c97652547248caadcf79bd64fc394 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 09:48:11 +0100 Subject: [PATCH 006/117] try to use github runner when available --- .github/workflows/pytest.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 12647f1bc5..088a3d3b7a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -40,9 +40,29 @@ jobs: id: conditions run: echo "run-tests=${{ github.ref == 'refs/heads/master' || (matrix.runner == 'ubuntu-20.04' && matrix.python-version == '3.8') }}" >> $GITHUB_ENV + - name: Check queue size + id: queue + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { data: { workflow_runs: runs } } = await github.actions.listWorkflowRuns({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: context.workflow, + branch: context.ref.replace('refs/heads/', ''), + status: 'queued', + }); + const count = runs.length; + return { + 'queue-size-exceeded': count > 30, + 'queue-size': count, + }; + outputs: python-version: ${{ matrix.python-version }} - runner: ${{ matrix.runner }} + # set runner to self-hosted if queue size is exceeded + runner: ${{ steps.queue.outputs['queue-size-exceeded'] == 'true' && 'self-hosted' || matrix.runner }} run-tests: ${{ env.run-tests }} # create a test matrix based on all python files in /tests From 6ea28b77dc596fee663b86c6bc8cd08a5168cfa5 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 09:57:49 +0100 Subject: [PATCH 007/117] Revert "try to use github runner when available" This reverts commit 3b6909493c8c97652547248caadcf79bd64fc394. --- .github/workflows/pytest.yml | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2f54ba578c..d5b89cd238 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -40,29 +40,9 @@ jobs: id: conditions run: echo "run-tests=${{ github.ref == 'refs/heads/master' || (matrix.runner == 'ubuntu-20.04' && matrix.python-version == '3.8') }}" >> $GITHUB_ENV - - name: Check queue size - id: queue - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { data: { workflow_runs: runs } } = await github.actions.listWorkflowRuns({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: context.workflow, - branch: context.ref.replace('refs/heads/', ''), - status: 'queued', - }); - const count = runs.length; - return { - 'queue-size-exceeded': count > 30, - 'queue-size': count, - }; - outputs: python-version: ${{ matrix.python-version }} - # set runner to self-hosted if queue size is exceeded - runner: ${{ steps.queue.outputs['queue-size-exceeded'] == 'true' && 'self-hosted' || matrix.runner }} + runner: ${{ matrix.runner }} run-tests: ${{ env.run-tests }} # create a test matrix based on all python files in /tests From 5c866c6c24fd3b8382a1d7a52efb595570f7c6dd Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 10:23:48 +0100 Subject: [PATCH 008/117] run all tests even if one fails --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d5b89cd238..3de1922670 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -70,6 +70,7 @@ jobs: runs-on: "self-hosted" strategy: matrix: ${{ fromJson(needs.list_tests.outputs.tests) }} + fail-fast: false # run all tests even if one fails steps: - uses: actions/checkout@v4 name: Check out source-code repository From 5bb519f2289d31f6a1889f17d1d6f4962804d1a9 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 10:52:50 +0100 Subject: [PATCH 009/117] print nextflow config --- .github/workflows/pytest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3de1922670..82260e31ac 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -114,7 +114,8 @@ jobs: run: | wget -qO- https://code.askimed.com/install/nf-test | bash sudo mv nf-test /usr/local/bin/ - + - name: print nextflow.config + run: cat nextflow.config - name: Test with pytest run: | python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core || exit_code=$? From 4f2b42de028c49ef649d1de6b795707c2d54880a Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 12:28:16 +0100 Subject: [PATCH 010/117] use full path for nextflow.config --- .github/workflows/pytest.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 82260e31ac..e82f00967a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -35,15 +35,10 @@ jobs: - python-version: "3.8" runner: "ubuntu-20.04" - steps: - - name: Check conditions - id: conditions - run: echo "run-tests=${{ github.ref == 'refs/heads/master' || (matrix.runner == 'ubuntu-20.04' && matrix.python-version == '3.8') }}" >> $GITHUB_ENV - outputs: python-version: ${{ matrix.python-version }} runner: ${{ matrix.runner }} - run-tests: ${{ env.run-tests }} + run-tests: ${{ github.ref == 'refs/heads/master' || (matrix.runner == 'ubuntu-20.04' && matrix.python-version == '3.8') }}" # create a test matrix based on all python files in /tests list_tests: @@ -115,7 +110,8 @@ jobs: wget -qO- https://code.askimed.com/install/nf-test | bash sudo mv nf-test /usr/local/bin/ - name: print nextflow.config - run: cat nextflow.config + run: cat /opt/actions-runner/nextflow.config + - name: Test with pytest run: | python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core || exit_code=$? From 5f79510482c945cfafde6ae0bca4a7a1e380c7e0 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 12:39:16 +0100 Subject: [PATCH 011/117] fix workflow --- .github/workflows/pytest.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e82f00967a..a7387129f5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -35,6 +35,11 @@ jobs: - python-version: "3.8" runner: "ubuntu-20.04" + steps: + - name: Check conditions + id: conditions + run: echo "run-tests=${{ github.ref == 'refs/heads/master' || (matrix.runner == 'ubuntu-20.04' && matrix.python-version == '3.8') }}" >> $GITHUB_ENV + outputs: python-version: ${{ matrix.python-version }} runner: ${{ matrix.runner }} From 498fca283da2c6d395d8437629a8afd7ba344db9 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 12:43:28 +0100 Subject: [PATCH 012/117] use different logic --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a7387129f5..5bb8df85ac 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -43,7 +43,7 @@ jobs: outputs: python-version: ${{ matrix.python-version }} runner: ${{ matrix.runner }} - run-tests: ${{ github.ref == 'refs/heads/master' || (matrix.runner == 'ubuntu-20.04' && matrix.python-version == '3.8') }}" + run-tests: ${{ steps.conditions.outputs.run-tests }} # create a test matrix based on all python files in /tests list_tests: From b0ef65a760b0c5b7fb76c130f684662d17c40300 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 12:47:12 +0100 Subject: [PATCH 013/117] revert --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5bb8df85ac..f3bb4121e3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -43,7 +43,7 @@ jobs: outputs: python-version: ${{ matrix.python-version }} runner: ${{ matrix.runner }} - run-tests: ${{ steps.conditions.outputs.run-tests }} + run-tests: ${{ env.run-tests }} # create a test matrix based on all python files in /tests list_tests: From 7a1e09539d081c797e9a6d692d5fd39e7e9dca86 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 14:33:24 +0100 Subject: [PATCH 014/117] try more self-hosted --- .github/workflows/create-lint-wf.yml | 2 +- .github/workflows/create-test-lint-wf-template.yml | 2 +- .github/workflows/create-test-wf.yml | 2 +- .github/workflows/fix-linting.yml | 2 +- .github/workflows/lint-code.yml | 10 +++++----- .github/workflows/sync.yml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index 152421b827..a3941f3ce1 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -17,7 +17,7 @@ env: jobs: MakeTestWorkflow: - runs-on: ubuntu-latest + runs-on: self-hosted env: NXF_ANSI_LOG: false strategy: diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 4be3098629..b14a0fac52 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -20,7 +20,7 @@ env: jobs: RunTestWorkflow: - runs-on: ubuntu-latest + runs-on: self-hosted env: NXF_ANSI_LOG: false strategy: diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 4f66adae6b..7b6a868f9e 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -17,7 +17,7 @@ env: jobs: RunTestWorkflow: - runs-on: ubuntu-latest + runs-on: self-hosted env: NXF_ANSI_LOG: false strategy: diff --git a/.github/workflows/fix-linting.yml b/.github/workflows/fix-linting.yml index d846151205..00a52583ec 100644 --- a/.github/workflows/fix-linting.yml +++ b/.github/workflows/fix-linting.yml @@ -10,7 +10,7 @@ jobs: contains(github.event.comment.html_url, '/pull/') && contains(github.event.comment.body, '@nf-core-bot fix linting') && github.repository == 'nf-core/tools' - runs-on: ubuntu-latest + runs-on: self-hosted steps: # Use the @nf-core-bot token to check out so we can push later - uses: actions/checkout@v4 diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index 5f053eb007..168fac653c 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -14,7 +14,7 @@ concurrency: jobs: EditorConfig: - runs-on: ["ubuntu-latest"] + runs-on: ["self-hosted"] steps: - uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: run: editorconfig-checker -exclude README.md $(git ls-files | grep -v 'test\|.py\|md\|json\|yml\|yaml\|html\|css\|Makefile') Prettier: - runs-on: ["ubuntu-latest"] + runs-on: ["self-hosted"] steps: - uses: actions/checkout@v4 @@ -45,7 +45,7 @@ jobs: run: prettier --check ${GITHUB_WORKSPACE} PythonBlack: - runs-on: ["ubuntu-latest"] + runs-on: ["self-hosted"] steps: - uses: actions/checkout@v4 @@ -75,7 +75,7 @@ jobs: allow-repeats: false isort: - runs-on: ["ubuntu-latest"] + runs-on: ["self-hosted"] steps: - name: Check out source-code repository uses: actions/checkout@v4 @@ -91,7 +91,7 @@ jobs: requirementsFiles: "requirements.txt requirements-dev.txt" static-type-check: - runs-on: ["ubuntu-latest"] + runs-on: ["self-hosted"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index b8fb287944..8351778dfa 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -16,7 +16,7 @@ concurrency: jobs: get-pipelines: - runs-on: ubuntu-latest + runs-on: self-hosted outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: @@ -31,7 +31,7 @@ jobs: sync: needs: get-pipelines - runs-on: ubuntu-latest + runs-on: self-hosted strategy: matrix: ${{fromJson(needs.get-pipelines.outputs.matrix)}} fail-fast: false From 4b0b238b399ac20e845d7efd712a7e74b6705066 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 1 Dec 2023 15:05:30 +0100 Subject: [PATCH 015/117] remove config options --- nf_core/pipeline-template/nextflow.config | 1 - 1 file changed, 1 deletion(-) diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index 31917a3e31..6a6bee6a83 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -121,7 +121,6 @@ profiles { shifter.enabled = false charliecloud.enabled = false apptainer.enabled = false - runOptions = '-u $(id -u):$(id -g)' } arm { docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' From 28a2a5858871b4c1986d673d986b26d428996ce3 Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 4 Dec 2023 10:26:10 +0100 Subject: [PATCH 016/117] switch to new profile --- .github/workflows/create-test-lint-wf-template.yml | 2 +- .github/workflows/create-test-wf.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 4be3098629..2a4273ee37 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -91,7 +91,7 @@ jobs: - name: run the pipeline run: | - nextflow run my-prefix-testpipeline -profile test,docker --outdir ./results + nextflow run my-prefix-testpipeline -profile test,self_hosted_runner --outdir ./results # Remove results folder before linting - name: remove results folder diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 4f66adae6b..ddae4ef2d9 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -47,7 +47,7 @@ jobs: - name: Run nf-core/tools run: | nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --plain - nextflow run nf-core-testpipeline -profile test,docker --outdir ./results + nextflow run nf-core-testpipeline -profile test,self_hosted_runner --outdir ./results - name: Upload log file artifact if: ${{ always() }} From 6022a1d68c7ed1a65d61dbaae8a3cc1d8a4bbe6f Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 4 Dec 2023 11:09:53 +0100 Subject: [PATCH 017/117] print config files, try fix for coverage creation --- .github/workflows/create-test-lint-wf-template.yml | 3 +++ .github/workflows/pytest.yml | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 8509ce6e8e..1a217fbd56 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -89,6 +89,9 @@ jobs: run: | nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --template-yaml ${{ matrix.TEMPLATE }} + - name: print configs + run: nextflow config + - name: run the pipeline run: | nextflow run my-prefix-testpipeline -profile test,self_hosted_runner --outdir ./results diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f3bb4121e3..2e0c38b922 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -60,8 +60,9 @@ jobs: - name: List tests id: list_tests run: - | # get all python files in /tests except __init__.py and also all subdirectories and remove trailing commas - echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV + | # get all python files in /tests strting with test_ excluding test_modules, test_subworkflows and test_components + echo "tests=$(find tests/test_* -not -name test_modules.py -not -name test_subworkflows.py -not -name test_components.py -name | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV + # test: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} @@ -149,12 +150,14 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements-dev.txt + - name: Download all artifacts # Downloads coverage1, coverage2, etc. uses: actions/download-artifact@v3 + - name: Run coverage run: | - coverage combine coverage*/.coverage* + coverage combine coverage*/.coverage* --sources=nf_core coverage report coverage xml - uses: codecov/codecov-action@v3 From 08f4d2832a35a5451aaa48ec0d109e0113dc2592 Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 4 Dec 2023 11:29:10 +0100 Subject: [PATCH 018/117] print configs with profiles --- .github/workflows/create-test-lint-wf-template.yml | 3 ++- .github/workflows/pytest.yml | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 1a217fbd56..5247bd71d3 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -90,7 +90,8 @@ jobs: nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --template-yaml ${{ matrix.TEMPLATE }} - name: print configs - run: nextflow config + run: | + echo "Configs: $(nextflow config -flat -profile test,self_hosted_runner)" - name: run the pipeline run: | diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2e0c38b922..b0b3ebbd1b 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -49,20 +49,21 @@ jobs: list_tests: name: Get test file matrix needs: setup - if: ${{ needs.setup.outputs.run-tests == 'true' }} + runs-on: ${{ needs.setup.outputs.runner }} outputs: tests: ${{ env.tests }} steps: - uses: actions/checkout@v4 name: Check out source-code repository - + - name: Print conditions + run: echo "run-tests=${{ needs.setup.outputs.run-tests }}" >> $GITHUB_ENV - name: List tests id: list_tests run: | # get all python files in /tests strting with test_ excluding test_modules, test_subworkflows and test_components - echo "tests=$(find tests/test_* -not -name test_modules.py -not -name test_subworkflows.py -not -name test_components.py -name | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV - # + echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV + if: ${{ needs.setup.outputs.run-tests == 'true' }} test: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} From 35cb092c780ca0271467fa3d98f03979cf377a79 Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 4 Dec 2023 12:43:35 +0100 Subject: [PATCH 019/117] fix config command --- .github/workflows/create-test-lint-wf-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 5247bd71d3..448666ad3a 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -91,7 +91,7 @@ jobs: - name: print configs run: | - echo "Configs: $(nextflow config -flat -profile test,self_hosted_runner)" + echo "Configs: $(nextflow config -flat -profile test,self_hosted_runner my-prefix-testpipeline)" - name: run the pipeline run: | From ac2acfc32f827c5842d7f05c63e18a0a3eb6c5ac Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 4 Dec 2023 12:55:06 +0100 Subject: [PATCH 020/117] simply list_tests --- .github/workflows/pytest.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b0b3ebbd1b..b5fc199507 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -48,22 +48,17 @@ jobs: # create a test matrix based on all python files in /tests list_tests: name: Get test file matrix - needs: setup - - runs-on: ${{ needs.setup.outputs.runner }} + runs-on: ["self-hosted"] outputs: tests: ${{ env.tests }} steps: - uses: actions/checkout@v4 name: Check out source-code repository - - name: Print conditions - run: echo "run-tests=${{ needs.setup.outputs.run-tests }}" >> $GITHUB_ENV - name: List tests id: list_tests run: | # get all python files in /tests strting with test_ excluding test_modules, test_subworkflows and test_components echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV - if: ${{ needs.setup.outputs.run-tests == 'true' }} test: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} From cd7fac24d1c94ab8c222a0c69cc2896aef142614 Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 4 Dec 2023 13:38:41 +0100 Subject: [PATCH 021/117] print more configs --- .github/workflows/create-test-wf.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index f20696cb9f..9b44138bd7 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -44,6 +44,10 @@ jobs: with: version: ${{ matrix.NXF_VER }} + - name: print configs + run: | + echo "Configs: $(nextflow config -flat -profile test,self_hosted_runner my-prefix-testpipeline)" + - name: Run nf-core/tools run: | nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --plain From 1e5c2d73315e513d94c007c23d839bcb7e9c665c Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 4 Dec 2023 13:55:49 +0100 Subject: [PATCH 022/117] don't print configs in this step --- .github/workflows/create-test-wf.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 9b44138bd7..f20696cb9f 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -44,10 +44,6 @@ jobs: with: version: ${{ matrix.NXF_VER }} - - name: print configs - run: | - echo "Configs: $(nextflow config -flat -profile test,self_hosted_runner my-prefix-testpipeline)" - - name: Run nf-core/tools run: | nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --plain From 0084d1567b9578f5baf54d83862029201aa5fd2b Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 4 Dec 2023 16:20:38 +0100 Subject: [PATCH 023/117] exclude some template settings to be able to use nf-core configs --- .github/workflows/create-test-lint-wf-template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 448666ad3a..f67c7f7d1a 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -26,11 +26,11 @@ jobs: strategy: matrix: TEMPLATE: - - "template_skip_all.yml" + # - "template_skip_all.yml" - "template_skip_github_badges.yml" - "template_skip_igenomes.yml" - "template_skip_ci.yml" - - "template_skip_nf_core_configs.yml" + # - "template_skip_nf_core_configs.yml" steps: - uses: actions/checkout@v4 From dddf94432c322ce144cdd195bfb33e2f8d7cba0b Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 5 Dec 2023 08:43:15 +0100 Subject: [PATCH 024/117] try to fix coverage upload --- .github/workflows/pytest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b5fc199507..8722f1a90e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -153,7 +153,7 @@ jobs: - name: Run coverage run: | - coverage combine coverage*/.coverage* --sources=nf_core - coverage report + coverage combine coverage*/.coverage* coverage xml - - uses: codecov/codecov-action@v3 + + - uses: codecov/codecov-action@v3 From 1423218cc97a45e613b8941d34004fe2767186d2 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 5 Dec 2023 11:22:30 +0100 Subject: [PATCH 025/117] debugging coverage step --- .github/workflows/pytest.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 8722f1a90e..60c0139be1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -58,7 +58,7 @@ jobs: id: list_tests run: | # get all python files in /tests strting with test_ excluding test_modules, test_subworkflows and test_components - echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV + echo "tests=$(find tests/test_cli* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV test: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} @@ -151,6 +151,11 @@ jobs: # Downloads coverage1, coverage2, etc. uses: actions/download-artifact@v3 + - name: Print working directory and list files + run: | + pwd + ls -l + - name: Run coverage run: | coverage combine coverage*/.coverage* From c997ab2062b5bccbd6722c4315173fa92d278559 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 5 Dec 2023 12:38:43 +0100 Subject: [PATCH 026/117] ignore coverage errors for now --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 60c0139be1..e4158c3e73 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -58,7 +58,7 @@ jobs: id: list_tests run: | # get all python files in /tests strting with test_ excluding test_modules, test_subworkflows and test_components - echo "tests=$(find tests/test_cli* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV + echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV test: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} @@ -159,6 +159,6 @@ jobs: - name: Run coverage run: | coverage combine coverage*/.coverage* - coverage xml + coverage xml -i - uses: codecov/codecov-action@v3 From d84a86f4f4677820ef98f68d801de81284d00c2f Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 5 Dec 2023 15:10:48 +0100 Subject: [PATCH 027/117] seems to work now? --- .github/workflows/pytest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e4158c3e73..7de17cb327 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -32,8 +32,8 @@ jobs: python-version: ["3.8", "3.12"] runner: ["ubuntu-latest"] include: - - python-version: "3.8" - runner: "ubuntu-20.04" + - runner: "ubuntu-20.04" + python-version: "3.8" steps: - name: Check conditions @@ -161,4 +161,4 @@ jobs: coverage combine coverage*/.coverage* coverage xml -i - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v3 From e23e6118a86bc189d849c7c0d7be0a080d328ba1 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 5 Dec 2023 16:23:59 +0100 Subject: [PATCH 028/117] add codecov token --- .github/workflows/pytest.yml | 3 +++ codecov.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 7de17cb327..ce9c69bc32 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -54,6 +54,7 @@ jobs: steps: - uses: actions/checkout@v4 name: Check out source-code repository + - name: List tests id: list_tests run: @@ -162,3 +163,5 @@ jobs: coverage xml -i - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/codecov.yml b/codecov.yml index 1ecf8960c0..23d09247bc 100644 --- a/codecov.yml +++ b/codecov.yml @@ -4,3 +4,6 @@ coverage: default: threshold: 5% patch: off +comment: + layout: "condensed_header, condensed_files, condensed_footer" # add "condensed_" to "header", "files" and "footer" + hide_project_coverage: TRUE # set to true From 9547c66ae7eac61ad9c6c1ce8fabde8ec875075d Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 5 Dec 2023 16:36:07 +0100 Subject: [PATCH 029/117] try to fix name collisions --- .github/workflows/pytest.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ce9c69bc32..08ba463e8d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -54,11 +54,14 @@ jobs: steps: - uses: actions/checkout@v4 name: Check out source-code repository + with: + path: "nf-core_tools" - name: List tests id: list_tests - run: - | # get all python files in /tests strting with test_ excluding test_modules, test_subworkflows and test_components + run: | + # get all python files in /tests strting with test_ excluding test_modules, test_subworkflows and test_components + cd nf-core_tools echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV test: @@ -72,6 +75,11 @@ jobs: steps: - uses: actions/checkout@v4 name: Check out source-code repository + with: + path: "nf-core_tools" + + - name: change to nf-core_tools directory + run: cd nf-core_tools - name: Set up Python ${{ needs.setup.outputs.python-version }} uses: actions/setup-python@v4 From 96b3152bcae2f997244e7843ce16c56bb31d22e4 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 5 Dec 2023 16:46:12 +0100 Subject: [PATCH 030/117] add github token to editorconfig step --- .github/workflows/lint-code.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index 168fac653c..b5e0feab60 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -15,6 +15,8 @@ concurrency: jobs: EditorConfig: runs-on: ["self-hosted"] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v4 From 02fa592383c4fb4c429e462c233665bc387f9365 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 5 Dec 2023 18:53:34 +0100 Subject: [PATCH 031/117] debug changed directory --- .github/workflows/pytest.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 08ba463e8d..78fa114d94 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -79,7 +79,7 @@ jobs: path: "nf-core_tools" - name: change to nf-core_tools directory - run: cd nf-core_tools + run: cd nf-core_tools && pwd - name: Set up Python ${{ needs.setup.outputs.python-version }} uses: actions/setup-python@v4 @@ -151,6 +151,10 @@ jobs: with: python-version: 3.12 cache: "pip" + + - name: change to nf-core_tools directory + run: cd nf-core_tools + - name: Install deps run: | python -m pip install --upgrade pip From a9981c5ac83a2162e915ed174fbee11e5d302414 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 5 Dec 2023 22:32:12 +0100 Subject: [PATCH 032/117] don't change path --- .github/workflows/pytest.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 78fa114d94..b878020513 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -54,14 +54,10 @@ jobs: steps: - uses: actions/checkout@v4 name: Check out source-code repository - with: - path: "nf-core_tools" - name: List tests id: list_tests run: | - # get all python files in /tests strting with test_ excluding test_modules, test_subworkflows and test_components - cd nf-core_tools echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV test: @@ -75,11 +71,6 @@ jobs: steps: - uses: actions/checkout@v4 name: Check out source-code repository - with: - path: "nf-core_tools" - - - name: change to nf-core_tools directory - run: cd nf-core_tools && pwd - name: Set up Python ${{ needs.setup.outputs.python-version }} uses: actions/setup-python@v4 @@ -99,6 +90,7 @@ jobs: sudo apt remove -y git git-man sudo add-apt-repository --remove ppa:git-core/ppa sudo apt install -y git + - name: Get current date id: date run: echo "date=$(date +'%Y-%m')" >> $GITHUB_ENV @@ -152,9 +144,6 @@ jobs: python-version: 3.12 cache: "pip" - - name: change to nf-core_tools directory - run: cd nf-core_tools - - name: Install deps run: | python -m pip install --upgrade pip @@ -164,11 +153,6 @@ jobs: # Downloads coverage1, coverage2, etc. uses: actions/download-artifact@v3 - - name: Print working directory and list files - run: | - pwd - ls -l - - name: Run coverage run: | coverage combine coverage*/.coverage* From 6b97c77af6a49bbb992fc2bab50047a908a9aeb0 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 6 Dec 2023 09:55:32 +0100 Subject: [PATCH 033/117] more codecov debuggin --- .github/workflows/pytest.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b878020513..9cfd7b26bf 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -158,6 +158,9 @@ jobs: coverage combine coverage*/.coverage* coverage xml -i + - name: show directory + run: ls -la + - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} From d0715e9f9a8e58a6bf20709dfc602893dad9e1e6 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 6 Dec 2023 11:02:41 +0100 Subject: [PATCH 034/117] specify codecov file --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 9cfd7b26bf..cdca23c959 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -164,3 +164,4 @@ jobs: - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} + file: coverage.xml From 3edb3db98eef9e61f1daff0a961dd428fad4be97 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Dec 2023 10:24:08 +0100 Subject: [PATCH 035/117] test on github runners, to see speed differences --- .github/workflows/pytest.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index cdca23c959..4564b1af26 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -58,13 +58,16 @@ jobs: - name: List tests id: list_tests run: | - echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV + tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}') + # reverse list to run slowest tests first + tests=$(echo $tests | jq '.test | reverse') + echo "tests" >> $GITHUB_ENV test: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} needs: [setup, list_tests] if: ${{ needs.setup.outputs.run-tests == 'true' }} - runs-on: "self-hosted" + runs-on: ${{ needs.setup.outputs.runner }} strategy: matrix: ${{ fromJson(needs.list_tests.outputs.tests) }} fail-fast: false # run all tests even if one fails From e107adab923c7df25d6f4e7e4bc39593bf561525 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Dec 2023 10:29:17 +0100 Subject: [PATCH 036/117] run also list_test in github --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 4564b1af26..97f001c26c 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -48,7 +48,7 @@ jobs: # create a test matrix based on all python files in /tests list_tests: name: Get test file matrix - runs-on: ["self-hosted"] + runs-on: "ubuntu-latest" outputs: tests: ${{ env.tests }} steps: From e3fa536d58a6603df3af1e59ee28127938793b0d Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Dec 2023 10:37:46 +0100 Subject: [PATCH 037/117] don't reverse for now --- .github/workflows/pytest.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 97f001c26c..20c6e22055 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -59,9 +59,7 @@ jobs: id: list_tests run: | tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}') - # reverse list to run slowest tests first - tests=$(echo $tests | jq '.test | reverse') - echo "tests" >> $GITHUB_ENV + echo $tests >> $GITHUB_ENV test: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} From d3ae3faf99ab5ffba4728f3b7d98c07e08d4d2e1 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Dec 2023 10:39:25 +0100 Subject: [PATCH 038/117] more reversion --- .github/workflows/pytest.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 20c6e22055..12063c6df4 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -58,8 +58,7 @@ jobs: - name: List tests id: list_tests run: | - tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}') - echo $tests >> $GITHUB_ENV + echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV test: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} From db88a83fa0e61cabd72ecf139c3b2bbdc4eeaa41 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Dec 2023 10:41:30 +0100 Subject: [PATCH 039/117] remove debugging --- .github/workflows/pytest.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 12063c6df4..dee5ba89a0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -112,8 +112,6 @@ jobs: run: | wget -qO- https://code.askimed.com/install/nf-test | bash sudo mv nf-test /usr/local/bin/ - - name: print nextflow.config - run: cat /opt/actions-runner/nextflow.config - name: Test with pytest run: | From b34f99f01afdbccbfd2522686f57eb8075528a7d Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Dec 2023 13:53:51 +0100 Subject: [PATCH 040/117] cleanup work directory --- .github/workflows/pytest.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 4564b1af26..e02017492a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -58,10 +58,7 @@ jobs: - name: List tests id: list_tests run: | - tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}') - # reverse list to run slowest tests first - tests=$(echo $tests | jq '.test | reverse') - echo "tests" >> $GITHUB_ENV + echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV test: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} @@ -115,8 +112,6 @@ jobs: run: | wget -qO- https://code.askimed.com/install/nf-test | bash sudo mv nf-test /usr/local/bin/ - - name: print nextflow.config - run: cat /opt/actions-runner/nextflow.config - name: Test with pytest run: | @@ -136,6 +131,10 @@ jobs: name: coverage${{ matrix.test }} path: .coverage + - name: Cleanup work directory + run: | + rm -rf work + coverage: needs: test runs-on: ubuntu-latest @@ -158,7 +157,9 @@ jobs: - name: Run coverage run: | + rm -f .coverage coverage combine coverage*/.coverage* + coverage report coverage xml -i - name: show directory From 50814d1028ab5cd3788d1b14e0ebb8340f441b51 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Dec 2023 14:00:12 +0100 Subject: [PATCH 041/117] switch to self-hosted again --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 0e7cb6e92e..7de9749206 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -48,7 +48,7 @@ jobs: # create a test matrix based on all python files in /tests list_tests: name: Get test file matrix - runs-on: "ubuntu-latest" + runs-on: "self-hosted" outputs: tests: ${{ env.tests }} steps: @@ -64,7 +64,7 @@ jobs: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} needs: [setup, list_tests] if: ${{ needs.setup.outputs.run-tests == 'true' }} - runs-on: ${{ needs.setup.outputs.runner }} + runs-on: self-hosted strategy: matrix: ${{ fromJson(needs.list_tests.outputs.tests) }} fail-fast: false # run all tests even if one fails From c4fa3458a2013469bde927595b475aad4a54dadf Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Dec 2023 14:12:49 +0100 Subject: [PATCH 042/117] don't need to install everything for coverage --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 7de9749206..ee0b4e2ae1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -149,7 +149,7 @@ jobs: - name: Install deps run: | python -m pip install --upgrade pip - pip install -r requirements-dev.txt + pip install coverage - name: Download all artifacts # Downloads coverage1, coverage2, etc. From fb8e644d5766c21ab643875098ba7f8ac135b5fd Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Dec 2023 15:27:03 +0100 Subject: [PATCH 043/117] always cleanup work directory --- .github/workflows/pytest.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ee0b4e2ae1..a8d8bfe52e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -58,7 +58,7 @@ jobs: - name: List tests id: list_tests run: | - echo "tests=$(find tests/test_* | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV + echo "tests=$(find tests/test_* | tac | sed 's/tests\///g' | jq -R -s -c '{test: (split("\n")[:-1])}')" >> $GITHUB_ENV test: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} @@ -134,6 +134,7 @@ jobs: - name: Cleanup work directory run: | rm -rf work + if: always() coverage: needs: test @@ -155,6 +156,9 @@ jobs: # Downloads coverage1, coverage2, etc. uses: actions/download-artifact@v3 + - name: show directory + run: tree + - name: Run coverage run: | rm -f .coverage From 82791ac59015bc129f18b7db6ae6a6024ecac65c Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 7 Dec 2023 16:31:27 +0100 Subject: [PATCH 044/117] debug coverage --- .github/workflows/pytest.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a8d8bfe52e..74c66626c1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -163,8 +163,7 @@ jobs: run: | rm -f .coverage coverage combine coverage*/.coverage* - coverage report - coverage xml -i + coverage report -m - name: show directory run: ls -la From 72b6553c3f0b4ce4f06fcaa3e1052172a5b4266f Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 8 Dec 2023 10:05:12 +0100 Subject: [PATCH 045/117] cleanup everything --- .github/workflows/create-lint-wf.yml | 4 ++++ .github/workflows/create-test-lint-wf-template.yml | 4 ++++ .github/workflows/create-test-wf.yml | 4 ++++ .github/workflows/pytest.yml | 3 +-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index a3941f3ce1..4911124acc 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -131,3 +131,7 @@ jobs: with: name: nf-core-log-file path: log.txt + + - name: Cleanup work directory + run: rm -rf work + if: always() diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index f67c7f7d1a..0ea2fff272 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -142,3 +142,7 @@ jobs: with: name: nf-core-log-file path: artifact_files.tar + + - name: Cleanup work directory + run: rm -rf work + if: always() diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index f20696cb9f..0247604396 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -55,3 +55,7 @@ jobs: with: name: nf-core-log-file path: log.txt + + - name: Cleanup work directory + run: rm -rf work + if: always() diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 74c66626c1..5be9434ac2 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -132,8 +132,7 @@ jobs: path: .coverage - name: Cleanup work directory - run: | - rm -rf work + run: rm -rf work if: always() coverage: From a1901f7e035a76742bf02559744a8f0e21289d62 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 8 Dec 2023 10:59:21 +0100 Subject: [PATCH 046/117] debugging coverage --- .github/workflows/pytest.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5be9434ac2..b1c6852e6d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -115,7 +115,7 @@ jobs: - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core || exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core -s || exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" @@ -156,13 +156,14 @@ jobs: uses: actions/download-artifact@v3 - name: show directory - run: tree + run: | + pwd + tree - name: Run coverage run: | rm -f .coverage coverage combine coverage*/.coverage* - coverage report -m - name: show directory run: ls -la From 9528d2854c5dd37cad0c1c8c954a6077b5dd8a66 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 8 Dec 2023 11:15:09 +0100 Subject: [PATCH 047/117] fail gracefully during cleanup --- .github/workflows/create-lint-wf.yml | 2 +- .github/workflows/create-test-lint-wf-template.yml | 2 +- .github/workflows/create-test-wf.yml | 3 ++- .github/workflows/pytest.yml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index 4911124acc..04548e0d76 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -133,5 +133,5 @@ jobs: path: log.txt - name: Cleanup work directory - run: rm -rf work + run: rm -rf work || true if: always() diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 0ea2fff272..e2a48152b5 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -144,5 +144,5 @@ jobs: path: artifact_files.tar - name: Cleanup work directory - run: rm -rf work + run: rm -rf work || true if: always() diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 0247604396..5b7e991998 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -57,5 +57,6 @@ jobs: path: log.txt - name: Cleanup work directory - run: rm -rf work + # cleanup and fail gracefully if I get a permission error + run: rm -rf work || true if: always() diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b1c6852e6d..92b1fdb256 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -132,7 +132,7 @@ jobs: path: .coverage - name: Cleanup work directory - run: rm -rf work + run: rm -rf work || true if: always() coverage: From 5c34797f2b40b8395a8dac7d35912b13c2b86334 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 8 Dec 2023 13:56:07 +0100 Subject: [PATCH 048/117] debug no cleaned up paths --- .github/workflows/create-lint-wf.yml | 5 +++++ .github/workflows/create-test-lint-wf-template.yml | 5 +++++ .github/workflows/create-test-wf.yml | 5 +++++ .github/workflows/pytest.yml | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index 04548e0d76..558939da20 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -26,6 +26,11 @@ jobs: - "23.04.0" - "latest-everything" steps: + - name: go to working directory + run: | + mkdir -p create-lint-wf + cd create-lint-wf + # Get the repo code - uses: actions/checkout@v4 name: Check out source-code repository diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index e2a48152b5..5a94d8a2d7 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -33,6 +33,11 @@ jobs: # - "template_skip_nf_core_configs.yml" steps: + - name: go to working directory + run: | + mkdir -p create-test-lint-wf-template + cd create-test-lint-wf-template + - uses: actions/checkout@v4 name: Check out source-code repository diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 5b7e991998..e0836582e1 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -26,6 +26,11 @@ jobs: - "23.04.0" - "latest-everything" steps: + - name: go to working directory + run: | + mkdir -p create-test-wf + cd create-test-wf + - uses: actions/checkout@v4 name: Check out source-code repository diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 92b1fdb256..8c420cbeb8 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -69,6 +69,11 @@ jobs: matrix: ${{ fromJson(needs.list_tests.outputs.tests) }} fail-fast: false # run all tests even if one fails steps: + - name: go to working directory + run: | + mkdir -p pytest + cd pytest + - uses: actions/checkout@v4 name: Check out source-code repository From c9510e254a82a3c0128529cd57a53e28044a525a Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 8 Dec 2023 14:14:22 +0100 Subject: [PATCH 049/117] install tools also in coverage job --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 8c420cbeb8..5c29423895 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -153,8 +153,8 @@ jobs: - name: Install deps run: | - python -m pip install --upgrade pip - pip install coverage + python -m pip install --upgrade pip -r requirements-dev.txt + pip install -e . - name: Download all artifacts # Downloads coverage1, coverage2, etc. From 05bbc2f74062d130ddb9d3d6ac9f05d5acd7db37 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 8 Dec 2023 14:22:01 +0100 Subject: [PATCH 050/117] add coverage report back in --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5c29423895..32f035fff1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -169,6 +169,8 @@ jobs: run: | rm -f .coverage coverage combine coverage*/.coverage* + coverage report + coverage xml - name: show directory run: ls -la From fc967132b3df0304aee6285e4daff8af39c2ad6c Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 8 Dec 2023 16:00:25 +0100 Subject: [PATCH 051/117] coverage debugging... --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 32f035fff1..e439efb734 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -163,7 +163,7 @@ jobs: - name: show directory run: | pwd - tree + ls -la /opt/actions-runner/_work/tools/tools - name: Run coverage run: | From 21b6c784618242731e528eb1e25afe3a4896f672 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 8 Dec 2023 16:22:03 +0100 Subject: [PATCH 052/117] change nextflow working dir --- .github/workflows/create-lint-wf.yml | 3 ++- .github/workflows/create-test-lint-wf-template.yml | 5 +++-- .github/workflows/create-test-wf.yml | 1 + .github/workflows/pytest.yml | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index 558939da20..57ae6b7592 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -26,10 +26,11 @@ jobs: - "23.04.0" - "latest-everything" steps: - - name: go to working directory + - name: go to subdirectory and change nextflow workdir run: | mkdir -p create-lint-wf cd create-lint-wf + export NXF_WORK=$(pwd) # Get the repo code - uses: actions/checkout@v4 diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 5a94d8a2d7..c22721c5a3 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -35,8 +35,9 @@ jobs: steps: - name: go to working directory run: | - mkdir -p create-test-lint-wf-template - cd create-test-lint-wf-template + mkdir -p create-lint-wf-template + cd create-lint-wf-template + export NXF_WORK=$(pwd) - uses: actions/checkout@v4 name: Check out source-code repository diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index e0836582e1..91d63c4ea5 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -30,6 +30,7 @@ jobs: run: | mkdir -p create-test-wf cd create-test-wf + export NXF_WORK=$(pwd) - uses: actions/checkout@v4 name: Check out source-code repository diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e439efb734..a9a22dd388 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -69,10 +69,11 @@ jobs: matrix: ${{ fromJson(needs.list_tests.outputs.tests) }} fail-fast: false # run all tests even if one fails steps: - - name: go to working directory + - name: go to subdirectory and change nextflow workdir run: | mkdir -p pytest cd pytest + export NXF_WORK=$(pwd) - uses: actions/checkout@v4 name: Check out source-code repository From 7a2188df2ad618de8eb1ca65e68bebf351553eae Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 8 Dec 2023 16:31:36 +0100 Subject: [PATCH 053/117] kick off tests --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a9a22dd388..ab3d13675f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -170,7 +170,7 @@ jobs: run: | rm -f .coverage coverage combine coverage*/.coverage* - coverage report + coverage report --debug=coverage coverage xml - name: show directory From d14c02fc38a6499e56bdbea3df2d48c627e26e5b Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 11 Dec 2023 14:18:27 +0100 Subject: [PATCH 054/117] add debugger ssh --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ab3d13675f..5dd8ca8871 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -165,6 +165,8 @@ jobs: run: | pwd ls -la /opt/actions-runner/_work/tools/tools + - name: Setup ssh session + uses: Warpbuilds/action-debugger@v1.3 - name: Run coverage run: | From 86d4ae2f5b28eaa2cc9440231da70e02be1e80a5 Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 11 Dec 2023 15:35:30 +0100 Subject: [PATCH 055/117] more debugging --- .github/workflows/pytest.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5dd8ca8871..b588854daa 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -121,7 +121,7 @@ jobs: - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core -s || exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core -s --durations=0 || exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" @@ -161,10 +161,6 @@ jobs: # Downloads coverage1, coverage2, etc. uses: actions/download-artifact@v3 - - name: show directory - run: | - pwd - ls -la /opt/actions-runner/_work/tools/tools - name: Setup ssh session uses: Warpbuilds/action-debugger@v1.3 From 49827b816b5961ca31c37c12c25817c6c8a42c9c Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 11 Dec 2023 16:49:55 +0100 Subject: [PATCH 056/117] try non-cached python --- .github/workflows/pytest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b588854daa..38d8c7c666 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -150,7 +150,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.12 - cache: "pip" - name: Install deps run: | From 187a5b1db2c5db1a93059b1b7a984319e2d81346 Mon Sep 17 00:00:00 2001 From: mashehu Date: Mon, 11 Dec 2023 17:48:53 +0100 Subject: [PATCH 057/117] figure out differences in paths --- .github/workflows/pytest.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 38d8c7c666..53ca54e03d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -74,6 +74,7 @@ jobs: mkdir -p pytest cd pytest export NXF_WORK=$(pwd) + echo $"which python: $(which python)" - uses: actions/checkout@v4 name: Check out source-code repository @@ -121,6 +122,7 @@ jobs: - name: Test with pytest run: | + echo "Which nf-core: $(which nf-core)" python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core -s --durations=0 || exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then @@ -160,11 +162,13 @@ jobs: # Downloads coverage1, coverage2, etc. uses: actions/download-artifact@v3 - - name: Setup ssh session - uses: Warpbuilds/action-debugger@v1.3 + # - name: Setup ssh session + # uses: Warpbuilds/action-debugger@v1.3 - name: Run coverage run: | + echo "Which nf-core: $(which nf-core)" + echo "Which python: $(which python)" rm -f .coverage coverage combine coverage*/.coverage* coverage report --debug=coverage From 4674b3f3b4ab7a692e6d169ac2e1a9e2508755f8 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 12 Dec 2023 15:42:48 +0100 Subject: [PATCH 058/117] trying to set the python directory manually --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 53ca54e03d..7143b65a7a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -150,6 +150,8 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python 3.9 uses: actions/setup-python@v4 + env: + AGENT_TOOLSDIRECTORY: /opt/actions-runner/_work/tools/tools/ with: python-version: 3.12 From f262b79a2bfc908c13bc0e849ed3533d434c98ff Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 13 Dec 2023 09:39:51 +0100 Subject: [PATCH 059/117] hopefully harmonizing python paths --- .github/workflows/pytest.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 7143b65a7a..f2f7147c0a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -81,6 +81,8 @@ jobs: - name: Set up Python ${{ needs.setup.outputs.python-version }} uses: actions/setup-python@v4 + env: + AGENT_TOOLSDIRECTORY: /opt/actions-runner/_work/tools/tools/ with: python-version: ${{ needs.setup.outputs.python-version }} cache: "pip" @@ -157,6 +159,7 @@ jobs: - name: Install deps run: | + cd pytest python -m pip install --upgrade pip -r requirements-dev.txt pip install -e . From cd4ae58c0dc548d02b539e6a323ad3939b54884d Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 13 Dec 2023 10:13:58 +0100 Subject: [PATCH 060/117] fix coverage step --- .github/workflows/pytest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f2f7147c0a..73b340f552 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -159,7 +159,6 @@ jobs: - name: Install deps run: | - cd pytest python -m pip install --upgrade pip -r requirements-dev.txt pip install -e . From 4e1029c2838364259eb2d9da2eba8bf75c6a98e7 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 13 Dec 2023 11:37:11 +0100 Subject: [PATCH 061/117] trying to fix the source error --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 73b340f552..24bf99d9b8 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -125,7 +125,7 @@ jobs: - name: Test with pytest run: | echo "Which nf-core: $(which nf-core)" - python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core -s --durations=0 || exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc -s --durations=0 || exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" From 86a771db23a028dbd6196ba027742c27abf31322 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 13 Dec 2023 15:22:03 +0100 Subject: [PATCH 062/117] specify full path for coverage --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 24bf99d9b8..70eb9ce2e9 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -125,7 +125,7 @@ jobs: - name: Test with pytest run: | echo "Which nf-core: $(which nf-core)" - python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc -s --durations=0 || exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov=$(realpath nf_core) --cov-report=xml --cov-config=.github/.coveragerc -s --durations=0 || exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" From e7bea3492dd5efba6ebb57861462ccf96d5ef099 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 08:05:06 +0100 Subject: [PATCH 063/117] copy more settings from pytest-split --- .github/.coveragerc | 3 +++ .github/workflows/pytest.yml | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/.coveragerc b/.github/.coveragerc index 522a29eb62..a13b37c38f 100644 --- a/.github/.coveragerc +++ b/.github/.coveragerc @@ -1,2 +1,5 @@ [run] omit = nf_core/pipeline-template/* +source = nf_core +relative_files = True + diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 70eb9ce2e9..6724348961 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -124,8 +124,7 @@ jobs: - name: Test with pytest run: | - echo "Which nf-core: $(which nf-core)" - python3 -m pytest tests/${{matrix.test}} --color=yes --cov=$(realpath nf_core) --cov-report=xml --cov-config=.github/.coveragerc -s --durations=0 || exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-report=xml --cov-config=.github/.coveragerc -s --durations=0 || exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" From 5dfd403d3acc8a21916cd7232e3d2242e92d0a6b Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 08:29:20 +0100 Subject: [PATCH 064/117] handle exit code better --- .github/workflows/pytest.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 6724348961..d525a36c61 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -122,9 +122,14 @@ jobs: wget -qO- https://code.askimed.com/install/nf-test | bash sudo mv nf-test /usr/local/bin/ + - name: export workdir + run: | + export NXF_WORK=$(pwd) + - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-report=xml --cov-config=.github/.coveragerc -s --durations=0 || exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-report=xml --cov-config=.github/.coveragerc -s --durations=0 + exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" From 08d7a62e6a0c1d4cd33708240be2df1fd56489ad Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 09:21:38 +0100 Subject: [PATCH 065/117] didn't work --- .github/workflows/pytest.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d525a36c61..c042416f44 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -128,8 +128,7 @@ jobs: - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-report=xml --cov-config=.github/.coveragerc -s --durations=0 - exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-report=xml --cov-config=.github/.coveragerc -s --durations=0 && exit_code=0 || exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" From 4fafbef13cc72579c1fcf5b39d5827318787986e Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 09:32:09 +0100 Subject: [PATCH 066/117] switch to new gitlab branch --- tests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils.py b/tests/utils.py index 198ac3d583..148912fe64 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -27,7 +27,7 @@ GITLAB_BRANCH_ORG_PATH_BRANCH = "org-path" GITLAB_BRANCH_TEST_OLD_SHA = "e772abc22c1ff26afdf377845c323172fb3c19ca" GITLAB_BRANCH_TEST_NEW_SHA = "7d73e21f30041297ea44367f2b4fd4e045c0b991" -GITLAB_NFTEST_BRANCH = "nf-test-tests" +GITLAB_NFTEST_BRANCH = "nf-test-tests-self-hosted-runners" def with_temporary_folder(func: Callable[..., Any]) -> Callable[..., Any]: From b2a9458a38d0ddff6b033263df7d7e956feb4e79 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 15:42:20 +0100 Subject: [PATCH 067/117] remove coverage output specification --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c042416f44..f6d65bce1b 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -128,7 +128,7 @@ jobs: - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-report=xml --cov-config=.github/.coveragerc -s --durations=0 && exit_code=0 || exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-config=.github/.coveragerc --durations=0 && exit_code=0 || exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" From 51bc286ed8f5ad40c228abc73a107e02407c8855 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 15:43:48 +0100 Subject: [PATCH 068/117] omit all template files in coverage --- .github/.coveragerc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/.coveragerc b/.github/.coveragerc index a13b37c38f..24a419ae07 100644 --- a/.github/.coveragerc +++ b/.github/.coveragerc @@ -1,5 +1,5 @@ [run] -omit = nf_core/pipeline-template/* +omit = nf_core/*-template/* source = nf_core relative_files = True From d376adea1e18e87b3f181138bf565c81b1867664 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 18:02:55 +0100 Subject: [PATCH 069/117] try different coverage_config path --- .github/workflows/pytest.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c31082722c..83519a8e36 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -128,7 +128,7 @@ jobs: - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-config=.github/.coveragerc --durations=0 && exit_code=0 || exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-config=./.github/.coveragerc --durations=0 && exit_code=0 || exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" @@ -141,8 +141,8 @@ jobs: - name: Upload coverage uses: actions/upload-artifact@v3 with: - name: coverage${{ matrix.test }} - path: .coverage + name: coverage_${{ matrix.test }} + path: coverage - name: Cleanup work directory run: rm -rf work || true @@ -186,5 +186,6 @@ jobs: - uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} file: coverage.xml + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 704e348fc21ba2aa88144b531c694f39f65189c5 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 19:09:37 +0100 Subject: [PATCH 070/117] fix coverage artifact upload --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 83519a8e36..cd7e05cd66 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -139,10 +139,10 @@ jobs: fi - name: Upload coverage - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage_${{ matrix.test }} - path: coverage + path: .coverage - name: Cleanup work directory run: rm -rf work || true From e2b846e8d22a822d5d53ed79526f9fccae6ed46f Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 19:11:07 +0100 Subject: [PATCH 071/117] upgrade artifact download --- .github/workflows/pytest.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index cd7e05cd66..9953b9ad8c 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -166,8 +166,7 @@ jobs: pip install -e . - name: Download all artifacts - # Downloads coverage1, coverage2, etc. - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 # - name: Setup ssh session # uses: Warpbuilds/action-debugger@v1.3 From 4fa2825db8a5990cc61c9e042baa4d21746dc308 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 20:32:01 +0100 Subject: [PATCH 072/117] run coverage step explicetly --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 9953b9ad8c..6cb3ecb363 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -137,6 +137,8 @@ jobs: echo "Tests failed with exit code ${exit_code}" exit 1 fi + - name: Report coverage + run: coverage report - name: Upload coverage uses: actions/upload-artifact@v4 @@ -173,8 +175,6 @@ jobs: - name: Run coverage run: | - echo "Which nf-core: $(which nf-core)" - echo "Which python: $(which python)" rm -f .coverage coverage combine coverage*/.coverage* coverage report --debug=coverage From 2ab397402fba31d74cafab8f1eacf2a566a9022c Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 14 Dec 2023 20:43:56 +0100 Subject: [PATCH 073/117] change location of coverage config --- .github/workflows/pytest.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 6cb3ecb363..d312354b27 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -122,13 +122,14 @@ jobs: wget -qO- https://code.askimed.com/install/nf-test | bash sudo mv nf-test /usr/local/bin/ - - name: export workdir + - name: export workdir & move coveragerc file up run: | export NXF_WORK=$(pwd) + mv .github/.coveragerc . - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-config=./.github/.coveragerc --durations=0 && exit_code=0 || exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 && exit_code=0 || exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" From 2031d069d6f480683e1b24954744ed349c6580ea Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 15 Dec 2023 07:29:49 +0100 Subject: [PATCH 074/117] add ssh debugger --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d312354b27..2d4dcd7c05 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -171,8 +171,8 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v4 - # - name: Setup ssh session - # uses: Warpbuilds/action-debugger@v1.3 + - name: Setup ssh session + uses: Warpbuilds/action-debugger@v1.3 - name: Run coverage run: | From 3d2009d06edeec4648a0a32acc23049894b7c5d7 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 15 Dec 2023 09:41:03 +0100 Subject: [PATCH 075/117] use old version of artifact upload --- .github/workflows/pytest.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2d4dcd7c05..4373873eba 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -142,7 +142,7 @@ jobs: run: coverage report - name: Upload coverage - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: coverage_${{ matrix.test }} path: .coverage @@ -156,7 +156,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.9 + - name: Set up Python 3.12 uses: actions/setup-python@v4 env: AGENT_TOOLSDIRECTORY: /opt/actions-runner/_work/tools/tools/ @@ -169,14 +169,13 @@ jobs: pip install -e . - name: Download all artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 - name: Setup ssh session uses: Warpbuilds/action-debugger@v1.3 - name: Run coverage run: | - rm -f .coverage coverage combine coverage*/.coverage* coverage report --debug=coverage coverage xml From 2bbb40a9d2986b2598946fa0d2cf7329599cfbc0 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 15 Dec 2023 13:50:04 +0100 Subject: [PATCH 076/117] debug artifact upload --- .github/workflows/pytest.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 4373873eba..c48bc74a3f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -139,7 +139,9 @@ jobs: exit 1 fi - name: Report coverage - run: coverage report + run: | + ls -la + coverage report --data-file=.coverage - name: Upload coverage uses: actions/upload-artifact@v3 @@ -171,8 +173,8 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v3 - - name: Setup ssh session - uses: Warpbuilds/action-debugger@v1.3 + # - name: Setup ssh session + # uses: Warpbuilds/action-debugger@v1.3 - name: Run coverage run: | From fbb50f346cf6606073e4d6c93d35a0377b497217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Mir=20Pedrol?= Date: Mon, 18 Dec 2023 12:51:12 +0000 Subject: [PATCH 077/117] use files codecov-action argument --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c48bc74a3f..1e177f10d5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -187,6 +187,6 @@ jobs: - uses: codecov/codecov-action@v3 with: - file: coverage.xml + files: coverage.xml env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From b831fb6d81136d2f1dc2f3feb039e778d3f2ec33 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 20 Dec 2023 13:27:49 +0100 Subject: [PATCH 078/117] debug coverage --- .github/workflows/pytest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d1a6b6db4a..f2c4263158 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -173,13 +173,13 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v3 - # - name: Setup ssh session - # uses: Warpbuilds/action-debugger@v1.3 + - name: Setup ssh session + uses: Warpbuilds/action-debugger@v1.3 - name: Run coverage run: | coverage combine coverage*/.coverage* - coverage report --debug=coverage + coverage report coverage xml - name: show directory From 76517c1b3636bfa35af2cd222667bd82217a2bf7 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 10:02:04 +0100 Subject: [PATCH 079/117] update action versions --- .github/workflows/create-lint-wf.yml | 2 +- .github/workflows/create-test-lint-wf-template.yml | 2 +- .github/workflows/create-test-wf.yml | 2 +- .github/workflows/deploy-pypi.yml | 2 +- .github/workflows/fix-linting.yml | 2 +- .github/workflows/lint-code.yml | 4 ++-- .github/workflows/pytest.yml | 8 ++++---- .github/workflows/rich-codex.yml | 2 +- .github/workflows/sync.yml | 2 +- .github/workflows/tools-api-docs-dev.yml | 2 +- .github/workflows/tools-api-docs-release.yml | 2 +- nf_core/pipeline-template/.github/workflows/linting.yml | 2 +- .../.github/workflows/release-announcements.yml | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index 9ddaf4b4c9..973351e2f6 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -38,7 +38,7 @@ jobs: # Set up nf-core/tools - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 941f6a71d0..cb754a62be 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -43,7 +43,7 @@ jobs: name: Check out source-code repository - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 1080bba22e..603113d080 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -36,7 +36,7 @@ jobs: name: Check out source-code repository - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/deploy-pypi.yml b/.github/workflows/deploy-pypi.yml index 62c53508d8..8d3a154d80 100644 --- a/.github/workflows/deploy-pypi.yml +++ b/.github/workflows/deploy-pypi.yml @@ -17,7 +17,7 @@ jobs: name: Check out source-code repository - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/fix-linting.yml b/.github/workflows/fix-linting.yml index bf23022c56..d0edee0903 100644 --- a/.github/workflows/fix-linting.yml +++ b/.github/workflows/fix-linting.yml @@ -41,7 +41,7 @@ jobs: options: "--color" - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 - name: python-isort diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index 6bb0a2481f..6462407840 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -83,7 +83,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 - name: python-isort @@ -96,7 +96,7 @@ jobs: runs-on: ["self-hosted"] steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: 3.11 cache: "pip" diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f2c4263158..666a3767cd 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -80,7 +80,7 @@ jobs: name: Check out source-code repository - name: Set up Python ${{ needs.setup.outputs.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 env: AGENT_TOOLSDIRECTORY: /opt/actions-runner/_work/tools/tools/ with: @@ -144,7 +144,7 @@ jobs: coverage report --data-file=.coverage - name: Upload coverage - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage_${{ matrix.test }} path: .coverage @@ -159,7 +159,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python 3.12 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 env: AGENT_TOOLSDIRECTORY: /opt/actions-runner/_work/tools/tools/ with: @@ -171,7 +171,7 @@ jobs: pip install -e . - name: Download all artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: Setup ssh session uses: Warpbuilds/action-debugger@v1.3 diff --git a/.github/workflows/rich-codex.yml b/.github/workflows/rich-codex.yml index 8368255390..b3e154c6dd 100644 --- a/.github/workflows/rich-codex.yml +++ b/.github/workflows/rich-codex.yml @@ -8,7 +8,7 @@ jobs: - name: Check out the repo uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.x cache: pip diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 789e4410a0..1fcbef89b8 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -49,7 +49,7 @@ jobs: fetch-depth: "0" - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/tools-api-docs-dev.yml b/.github/workflows/tools-api-docs-dev.yml index 89720fb137..80d3b9365f 100644 --- a/.github/workflows/tools-api-docs-dev.yml +++ b/.github/workflows/tools-api-docs-dev.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/tools-api-docs-release.yml b/.github/workflows/tools-api-docs-release.yml index b0869190d9..3233e00ca9 100644 --- a/.github/workflows/tools-api-docs-release.yml +++ b/.github/workflows/tools-api-docs-release.yml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/nf_core/pipeline-template/.github/workflows/linting.yml b/nf_core/pipeline-template/.github/workflows/linting.yml index 94aa5278be..806e23b332 100644 --- a/nf_core/pipeline-template/.github/workflows/linting.yml +++ b/nf_core/pipeline-template/.github/workflows/linting.yml @@ -76,7 +76,7 @@ jobs: - name: Install Nextflow uses: nf-core/setup-nextflow@v1 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" architecture: "x64" diff --git a/nf_core/pipeline-template/.github/workflows/release-announcements.yml b/nf_core/pipeline-template/.github/workflows/release-announcements.yml index ad497db4e1..a0dd5a03cf 100644 --- a/nf_core/pipeline-template/.github/workflows/release-announcements.yml +++ b/nf_core/pipeline-template/.github/workflows/release-announcements.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.10" - name: Install dependencies From 8e52118a5de799b112f12dee41d402de49a20e33 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 10:17:13 +0100 Subject: [PATCH 080/117] fix cleanup step --- .github/workflows/create-lint-wf.yml | 2 +- .github/workflows/create-test-lint-wf-template.yml | 2 +- .github/workflows/create-test-wf.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index 973351e2f6..ccab2af6d4 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -154,5 +154,5 @@ jobs: path: create-lint-wf/log.txt - name: Cleanup work directory - run: rm -rf work || true + run: rm -rf create-lint-wf || true if: always() diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index cb754a62be..8e726a4e25 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -157,5 +157,5 @@ jobs: path: create-test-lint-wf/artifact_files.tar - name: Cleanup work directory - run: rm -rf work || true + run: rm -rf create-test-lint-wf || true if: always() diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 603113d080..86e8711fb2 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -66,5 +66,5 @@ jobs: - name: Cleanup work directory # cleanup and fail gracefully if I get a permission error - run: rm -rf work || true + run: rm -rf create-test-wf || true if: always() From e389c8c80d2675170abd5cc9559d7de5028be47a Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 10:17:29 +0100 Subject: [PATCH 081/117] run small jobs still on github --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 666a3767cd..a529a0a65c 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -26,7 +26,7 @@ env: jobs: setup: - runs-on: ["self-hosted"] + runs-on: "ubuntu-latest" strategy: matrix: python-version: ["3.8", "3.11"] @@ -48,7 +48,7 @@ jobs: # create a test matrix based on all python files in /tests list_tests: name: Get test file matrix - runs-on: "self-hosted" + runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 name: Check out source-code repository From 7eb8d0bc920e921f6da398deb46c02cd142dd631 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 10:25:44 +0100 Subject: [PATCH 082/117] switch to pre-commit for code linting --- .github/workflows/lint-code.yml | 111 ++------------------------------ .pre-commit-config.yaml | 2 +- 2 files changed, 7 insertions(+), 106 deletions(-) diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index 6462407840..1bd042a6b7 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -14,120 +14,21 @@ concurrency: jobs: EditorConfig: - runs-on: ["self-hosted"] + runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install editorconfig-checker - run: npm install -g editorconfig-checker - - # Run editor config check only on files not covered by a linter - - name: Run ECLint check - run: editorconfig-checker -exclude README.md $(git ls-files | grep -v 'test\|.py\|md\|json\|yml\|yaml\|html\|css\|Makefile') - - Prettier: - runs-on: ["self-hosted"] - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install Prettier - run: npm install -g prettier - - - name: Run Prettier --check - run: prettier --check ${GITHUB_WORKSPACE} - - PythonBlack: - runs-on: ["self-hosted"] - steps: - - uses: actions/checkout@v4 - - - name: Check code lints with Black - uses: psf/black@stable - - # If the above check failed, post a comment on the PR explaining the failure - - name: Post PR comment - if: failure() - uses: mshick/add-pr-comment@v1 - with: - message: | - ## Python linting (`black`) is failing - - To keep the code consistent with lots of contributors, we run automated code consistency checks. - To fix this CI test, please run: - - * Install [`black`](https://black.readthedocs.io/en/stable/): `pip install black` - * Fix formatting errors in your pipeline: `black .` - - Once you push these changes the test should pass, and you can hide this comment :+1: - - We highly recommend setting up Black in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help! - - Thanks again for your contribution! - repo-token: ${{ secrets.GITHUB_TOKEN }} - allow-repeats: false - - isort: - runs-on: ["self-hosted"] - steps: - - name: Check out source-code repository - uses: actions/checkout@v4 - - name: Set up Python 3.11 uses: actions/setup-python@v5 - with: - python-version: 3.11 - - name: python-isort - uses: isort/isort-action@v1.1.0 - with: - isortVersion: "latest" - requirementsFiles: "requirements.txt requirements-dev.txt" - - static-type-check: - runs-on: ["self-hosted"] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 with: python-version: 3.11 cache: "pip" - - name: Install dependencies - run: | - python -m pip install --upgrade pip -r requirements-dev.txt - pip install -e . + - name: Install pre-commit + run: pip install pre-commit - - 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: Get Python changed files - id: changed-py-files - uses: tj-actions/changed-files@v23 - with: - files: | - *.py - **/*.py - - name: Run if any of the listed files above is changed - if: steps.changed-py-files.outputs.any_changed == 'true' - run: mypy ${{ steps.changed-py-files.outputs.all_changed_files }} + - name: Run pre-commit + id: prettier_status + run: pre-commit run --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ad23a3c895..31c31800f4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.7.1" # Use the sha / tag you want to point at + rev: "v1.8.0" hooks: - id: mypy additional_dependencies: From 5b283d96847dc483054826a18e93effdb977a3dc Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 10:29:37 +0100 Subject: [PATCH 083/117] don't run pyupgrade for now --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 31c31800f4..5833865b62 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,11 +11,11 @@ repos: rev: "v2.7.1" hooks: - id: prettier - - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 - hooks: - - id: pyupgrade - args: [--py38-plus] + # - repo: https://github.com/asottile/pyupgrade + # rev: v3.15.0 + # hooks: + # - id: pyupgrade + # args: [--py38-plus] - repo: https://github.com/pre-commit/mirrors-mypy rev: "v1.8.0" hooks: From b6996518199244ea020d9be2b1796df427eb792c Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 10:30:43 +0100 Subject: [PATCH 084/117] fix job name --- .github/workflows/lint-code.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index 1bd042a6b7..b002a705f5 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -13,7 +13,7 @@ concurrency: cancel-in-progress: true jobs: - EditorConfig: + Pre-commit: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e5b0f4d53cffb222039efc93ac7dc516d14bce9b Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 12:55:58 +0100 Subject: [PATCH 085/117] debugging --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a529a0a65c..a7e5b6a827 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -173,6 +173,7 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v4 + #debugging - name: Setup ssh session uses: Warpbuilds/action-debugger@v1.3 From ce1bd2f1143d85306841842aa2baf455b954bf9b Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 13:01:05 +0100 Subject: [PATCH 086/117] keep coverage files --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a7e5b6a827..5d100cfede 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -179,7 +179,7 @@ jobs: - name: Run coverage run: | - coverage combine coverage*/.coverage* + coverage combine coverage*/.coverage* --keep coverage report coverage xml From 3b21894923ef9d406521a54f36f194bb5993e532 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 13:47:16 +0100 Subject: [PATCH 087/117] test better cleanup --- .github/workflows/create-lint-wf.yml | 2 +- .github/workflows/create-test-lint-wf-template.yml | 2 +- .github/workflows/create-test-wf.yml | 2 +- .github/workflows/pytest.yml | 4 ---- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index ccab2af6d4..1c9c458300 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -154,5 +154,5 @@ jobs: path: create-lint-wf/log.txt - name: Cleanup work directory - run: rm -rf create-lint-wf || true + run: rm -rf create-lint-wf if: always() diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 8e726a4e25..d650b7fa9d 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -157,5 +157,5 @@ jobs: path: create-test-lint-wf/artifact_files.tar - name: Cleanup work directory - run: rm -rf create-test-lint-wf || true + run: rm -rf create-test-lint-wf if: always() diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 86e8711fb2..8cd00e9407 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -66,5 +66,5 @@ jobs: - name: Cleanup work directory # cleanup and fail gracefully if I get a permission error - run: rm -rf create-test-wf || true + run: rm -rf create-test-wf if: always() diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5d100cfede..3a35c6a215 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -149,10 +149,6 @@ jobs: name: coverage_${{ matrix.test }} path: .coverage - - name: Cleanup work directory - run: rm -rf work || true - if: always() - coverage: needs: test runs-on: ubuntu-latest From 0ba7f4927cda289278629665f2f64d2420752472 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 14:18:06 +0100 Subject: [PATCH 088/117] fix parameter position --- .github/workflows/pytest.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3a35c6a215..8891a0cebd 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -154,12 +154,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 + - name: Set up Python 3.11 uses: actions/setup-python@v5 env: AGENT_TOOLSDIRECTORY: /opt/actions-runner/_work/tools/tools/ with: - python-version: 3.12 + python-version: 3.11 + cache: "pip" - name: Install deps run: | @@ -175,7 +176,7 @@ jobs: - name: Run coverage run: | - coverage combine coverage*/.coverage* --keep + coverage combine --keep coverage*/.coverage* coverage report coverage xml From 10da34dcdeeb0b51ac5b35fdc1be10916e04c2f5 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 14:19:35 +0100 Subject: [PATCH 089/117] add cleanup step to nextflow steps --- .github/workflows/create-test-lint-wf-template.yml | 2 +- .github/workflows/create-test-wf.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index d650b7fa9d..24a77143c3 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -101,7 +101,7 @@ jobs: - name: run the pipeline run: | cd create-test-lint-wf - nextflow run my-prefix-testpipeline -profile test,self_hosted_runner --outdir ./results + nextflow run my-prefix-testpipeline -profile test,self_hosted_runner --outdir ./results -cleanup # Remove results folder before linting - name: remove results folder diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 8cd00e9407..f15e9ff5d8 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -55,7 +55,7 @@ jobs: mkdir create-test-wf && cd create-test-wf export NXF_WORK=$(pwd) nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --plain - nextflow run nf-core-testpipeline -profile test,self_hosted_runner --outdir ./results + nextflow run nf-core-testpipeline -profile test,self_hosted_runner --outdir ./results -cleanup - name: Upload log file artifact if: ${{ always() }} @@ -65,6 +65,6 @@ jobs: path: create-test-wf/log.txt - name: Cleanup work directory - # cleanup and fail gracefully if I get a permission error + # cleanup work directory run: rm -rf create-test-wf if: always() From 3b2e86a59adff9e4621b8bd3494c3ee6f124b87e Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 14:28:11 +0100 Subject: [PATCH 090/117] use nextflow clean --- .github/workflows/create-test-lint-wf-template.yml | 3 ++- .github/workflows/create-test-wf.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 24a77143c3..5b36a2abee 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -101,7 +101,8 @@ jobs: - name: run the pipeline run: | cd create-test-lint-wf - nextflow run my-prefix-testpipeline -profile test,self_hosted_runner --outdir ./results -cleanup + nextflow run my-prefix-testpipeline -profile test,self_hosted_runner --outdir ./results + nextflow clean -f # Remove results folder before linting - name: remove results folder diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index f15e9ff5d8..65df0014b3 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -55,7 +55,8 @@ jobs: mkdir create-test-wf && cd create-test-wf export NXF_WORK=$(pwd) nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --plain - nextflow run nf-core-testpipeline -profile test,self_hosted_runner --outdir ./results -cleanup + nextflow run nf-core-testpipeline -profile test,self_hosted_runner --outdir ./results + nextflow clean -f - name: Upload log file artifact if: ${{ always() }} From 0f446f658f1ab5b9a0107f4717be8a074c8e2da0 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 14:39:52 +0100 Subject: [PATCH 091/117] remove ssh step --- .github/workflows/pytest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 8891a0cebd..4105f6ae44 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -170,9 +170,9 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v4 - #debugging - - name: Setup ssh session - uses: Warpbuilds/action-debugger@v1.3 + # #debugging + # - name: Setup ssh session + # uses: Warpbuilds/action-debugger@v1.3 - name: Run coverage run: | From e2137b633e2d03d68d12219e3f83e4af2dd32921 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 16:09:51 +0100 Subject: [PATCH 092/117] test cirun.io --- .cirun.yml | 15 +++++++++++++++ .github/workflows/pytest.yml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .cirun.yml diff --git a/.cirun.yml b/.cirun.yml new file mode 100644 index 0000000000..4b408b1d99 --- /dev/null +++ b/.cirun.yml @@ -0,0 +1,15 @@ +# Self-Hosted Github Action Runners on AWS via Cirun.io +# Reference: https://docs.cirun.io/reference/yaml +runners: + - name: "aws-runner" + # Cloud Provider: AWS + cloud: "aws" + instance_type: "t3a.large" + # Ubuntu-20.4, ami image + machine_image: "ami-0905a3c97561e0b69" + preemptible: false + region: "eu-west-1" + # Add this label in the "runs-on" param in .github/workflows/.yml + # So that this runner is created for running the workflow + labels: + - "cirun-aws-runner" diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 4105f6ae44..f10b6fadca 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -64,7 +64,7 @@ jobs: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} needs: [setup, list_tests] if: ${{ needs.setup.outputs.run-tests }} - runs-on: self-hosted + runs-on: cirun-aws-runner strategy: matrix: ${{ fromJson(needs.list_tests.outputs.tests) }} fail-fast: false # run all tests even if one fails From b72914187bf29e2e9ceccf0c9d48894d22a7f8b2 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 16:22:57 +0100 Subject: [PATCH 093/117] don't set AGENT_TOOLSDIRECTORY --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f10b6fadca..0481dfd962 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -81,8 +81,8 @@ jobs: - name: Set up Python ${{ needs.setup.outputs.python-version }} uses: actions/setup-python@v5 - env: - AGENT_TOOLSDIRECTORY: /opt/actions-runner/_work/tools/tools/ + # env: + # AGENT_TOOLSDIRECTORY: /opt/actions-runner/_work/tools/tools/ with: python-version: ${{ needs.setup.outputs.python-version }} cache: "pip" From a37f0e46d52113d7fc368d663cd1ab6afe549622 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 16:29:28 +0100 Subject: [PATCH 094/117] add java setup step --- .github/workflows/pytest.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 0481dfd962..1a2b7cacc9 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -104,6 +104,12 @@ jobs: id: date run: echo "date=$(date +'%Y-%m')" >> $GITHUB_ENV + - name: Install Java + uses: actions/setup-java@v4 + with: + distribution: "temurin" # See 'Supported distributions' for available options + java-version: "21" + - name: Install Nextflow uses: nf-core/setup-nextflow@v1 From af55c3483dafc4b490e3b44a2978be66d8f2bb1a Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 19:14:26 +0100 Subject: [PATCH 095/117] use general gitlab branch --- .cirun.yml | 2 +- tests/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirun.yml b/.cirun.yml index 4b408b1d99..7a4f9726d0 100644 --- a/.cirun.yml +++ b/.cirun.yml @@ -6,7 +6,7 @@ runners: cloud: "aws" instance_type: "t3a.large" # Ubuntu-20.4, ami image - machine_image: "ami-0905a3c97561e0b69" + machine_image: "ami-for-eu-west-1" preemptible: false region: "eu-west-1" # Add this label in the "runs-on" param in .github/workflows/.yml diff --git a/tests/utils.py b/tests/utils.py index 148912fe64..198ac3d583 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -27,7 +27,7 @@ GITLAB_BRANCH_ORG_PATH_BRANCH = "org-path" GITLAB_BRANCH_TEST_OLD_SHA = "e772abc22c1ff26afdf377845c323172fb3c19ca" GITLAB_BRANCH_TEST_NEW_SHA = "7d73e21f30041297ea44367f2b4fd4e045c0b991" -GITLAB_NFTEST_BRANCH = "nf-test-tests-self-hosted-runners" +GITLAB_NFTEST_BRANCH = "nf-test-tests" def with_temporary_folder(func: Callable[..., Any]) -> Callable[..., Any]: From 2c9e44386ef573c1f0c1666a62ac8a9e884e73aa Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 2 Jan 2024 19:20:05 +0100 Subject: [PATCH 096/117] change image id back --- .cirun.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirun.yml b/.cirun.yml index 7a4f9726d0..4b408b1d99 100644 --- a/.cirun.yml +++ b/.cirun.yml @@ -6,7 +6,7 @@ runners: cloud: "aws" instance_type: "t3a.large" # Ubuntu-20.4, ami image - machine_image: "ami-for-eu-west-1" + machine_image: "ami-0905a3c97561e0b69" preemptible: false region: "eu-west-1" # Add this label in the "runs-on" param in .github/workflows/.yml From 18090fffd295d46845b26641e2bf2d52d42b68f2 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 4 Jan 2024 11:29:36 +0100 Subject: [PATCH 097/117] debug cleanup step --- .github/workflows/create-test-lint-wf-template.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 5b36a2abee..2b39d055b3 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -157,6 +157,10 @@ jobs: name: nf-core-log-file path: create-test-lint-wf/artifact_files.tar + #debugging + - name: Setup ssh session + uses: Warpbuilds/action-debugger@v1.3 + - name: Cleanup work directory run: rm -rf create-test-lint-wf if: always() From 32dcbf3c3a938e927f74bc506e809a6c1ae9fbf1 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 4 Jan 2024 12:04:04 +0100 Subject: [PATCH 098/117] use sudo rm --- .github/workflows/create-lint-wf.yml | 2 +- .github/workflows/create-test-lint-wf-template.yml | 6 +----- .github/workflows/create-test-wf.yml | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index 1d00eaedbf..cfd36385ea 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -163,5 +163,5 @@ jobs: path: create-lint-wf/log.txt - name: Cleanup work directory - run: rm -rf create-lint-wf + run: sudo rm -rf create-lint-wf if: always() diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 2b39d055b3..94cd4d8663 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -157,10 +157,6 @@ jobs: name: nf-core-log-file path: create-test-lint-wf/artifact_files.tar - #debugging - - name: Setup ssh session - uses: Warpbuilds/action-debugger@v1.3 - - name: Cleanup work directory - run: rm -rf create-test-lint-wf + run: sudo rm -rf create-test-lint-wf if: always() diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 65df0014b3..de06df5817 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -67,5 +67,5 @@ jobs: - name: Cleanup work directory # cleanup work directory - run: rm -rf create-test-wf + run: sudo rm -rf create-test-wf if: always() From e81b6584a3c63094adf316a4ff192034b7e75a9c Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 4 Jan 2024 12:50:59 +0100 Subject: [PATCH 099/117] run everything on our own runners again --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 1a2b7cacc9..922ce4d74d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -64,7 +64,7 @@ jobs: name: Run ${{matrix.test}} with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }} needs: [setup, list_tests] if: ${{ needs.setup.outputs.run-tests }} - runs-on: cirun-aws-runner + runs-on: self-hosted strategy: matrix: ${{ fromJson(needs.list_tests.outputs.tests) }} fail-fast: false # run all tests even if one fails @@ -157,7 +157,7 @@ jobs: coverage: needs: test - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v4 - name: Set up Python 3.11 From 1cffa1eeb7c1be8eb66001ee55046f3cc68517e6 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 4 Jan 2024 12:59:27 +0100 Subject: [PATCH 100/117] use correct gitlab branch --- tests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils.py b/tests/utils.py index 44386759ed..89c1328818 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -25,7 +25,7 @@ GITLAB_BRANCH_ORG_PATH_BRANCH = "org-path" GITLAB_BRANCH_TEST_OLD_SHA = "e772abc22c1ff26afdf377845c323172fb3c19ca" GITLAB_BRANCH_TEST_NEW_SHA = "7d73e21f30041297ea44367f2b4fd4e045c0b991" -GITLAB_NFTEST_BRANCH = "nf-test-tests" +GITLAB_NFTEST_BRANCH = "nf-test-tests-self-hosted-runners" def with_temporary_folder(func: Callable[..., Any]) -> Callable[..., Any]: From f7fe4f0e710e2f1d1bebde6705bb177c7e95b152 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 4 Jan 2024 14:28:24 +0100 Subject: [PATCH 101/117] use java from runners --- .github/workflows/pytest.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 922ce4d74d..24888264cb 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -104,12 +104,6 @@ jobs: id: date run: echo "date=$(date +'%Y-%m')" >> $GITHUB_ENV - - name: Install Java - uses: actions/setup-java@v4 - with: - distribution: "temurin" # See 'Supported distributions' for available options - java-version: "21" - - name: Install Nextflow uses: nf-core/setup-nextflow@v1 From 29534655ebc3bc3981bf161ac3977979cc9b83c0 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 4 Jan 2024 14:55:40 +0100 Subject: [PATCH 102/117] test coverage for one file --- .github/workflows/pytest.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 24888264cb..95b61c84a6 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -165,7 +165,6 @@ jobs: - name: Install deps run: | python -m pip install --upgrade pip -r requirements-dev.txt - pip install -e . - name: Download all artifacts uses: actions/download-artifact@v4 @@ -173,7 +172,9 @@ jobs: # #debugging # - name: Setup ssh session # uses: Warpbuilds/action-debugger@v1.3 - + - name: Run coverage on one file + run: | + coverage report --data-file=coverage_test_components.py/.coverage - name: Run coverage run: | coverage combine --keep coverage*/.coverage* From 418e9788bd6053bf64b1d66c23d526e72cd419d8 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 4 Jan 2024 15:49:25 +0100 Subject: [PATCH 103/117] run individual test also parallel --- .github/workflows/pytest.yml | 2 +- requirements-dev.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 95b61c84a6..64ab685cd9 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -129,7 +129,7 @@ jobs: - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 && exit_code=0 || exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 -n auto && exit_code=0|| exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" diff --git a/requirements-dev.txt b/requirements-dev.txt index 6d890f0e1f..dc3bf4f47d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,7 @@ myst_parser pytest-cov pytest-datafiles +pytest-xdist responses Sphinx sphinx-rtd-theme From e822600b66109c640b5da377b2e93536c5c6786f Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 4 Jan 2024 15:51:37 +0100 Subject: [PATCH 104/117] add github token to setup-python --- .github/workflows/pytest.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 64ab685cd9..9b71127d0a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -81,11 +81,10 @@ jobs: - name: Set up Python ${{ needs.setup.outputs.python-version }} uses: actions/setup-python@v5 - # env: - # AGENT_TOOLSDIRECTORY: /opt/actions-runner/_work/tools/tools/ with: python-version: ${{ needs.setup.outputs.python-version }} cache: "pip" + token: ${{ secrets.GITHUB_TOKEN }} - name: Install dependencies run: | From 3f5310d8a1b0896ef2c2991fffc1efe525cc6f1b Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 4 Jan 2024 16:49:49 +0100 Subject: [PATCH 105/117] use same directory structure for coverage --- .github/workflows/pytest.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 9b71127d0a..0b68e3aee2 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -128,7 +128,7 @@ jobs: - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 -n auto && exit_code=0|| exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 -n 2 && exit_code=0|| exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" @@ -152,6 +152,11 @@ jobs: needs: test runs-on: self-hosted steps: + - name: go to subdirectory + run: | + mkdir -p pytest + cd pytest + - uses: actions/checkout@v4 - name: Set up Python 3.11 uses: actions/setup-python@v5 From 71c4901b95b95fe51e0fc3fb2b0ee8f657eb2d62 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 4 Jan 2024 17:04:36 +0100 Subject: [PATCH 106/117] don't ran everything parallel --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 0b68e3aee2..db8f2e4da1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -128,7 +128,7 @@ jobs: - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 -n 2 && exit_code=0|| exit_code=$? + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 && exit_code=0|| exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected" From ecb21e48b02abaa67a463d5c92213a489055df93 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 08:44:23 +0100 Subject: [PATCH 107/117] move coveragerc --- .github/workflows/pytest.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index db8f2e4da1..de4dcf5677 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -166,9 +166,14 @@ jobs: python-version: 3.11 cache: "pip" - - name: Install deps + - name: Install dependencies run: | python -m pip install --upgrade pip -r requirements-dev.txt + pip install -e . + + - name: move coveragerc file up + run: | + mv .github/.coveragerc . - name: Download all artifacts uses: actions/download-artifact@v4 From 161412996b9afa0231ffb03a93d7ff7db4455c86 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 09:15:40 +0100 Subject: [PATCH 108/117] remove debugging code --- .github/workflows/pytest.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index de4dcf5677..e37c8c00ff 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -74,7 +74,6 @@ jobs: mkdir -p pytest cd pytest export NXF_WORK=$(pwd) - echo $"which python: $(which python)" - uses: actions/checkout@v4 name: Check out source-code repository @@ -121,9 +120,8 @@ jobs: wget -qO- https://code.askimed.com/install/nf-test | bash sudo mv nf-test /usr/local/bin/ - - name: export workdir & move coveragerc file up + - name: move coveragerc file up run: | - export NXF_WORK=$(pwd) mv .github/.coveragerc . - name: Test with pytest @@ -137,10 +135,6 @@ jobs: echo "Tests failed with exit code ${exit_code}" exit 1 fi - - name: Report coverage - run: | - ls -la - coverage report --data-file=.coverage - name: Upload coverage uses: actions/upload-artifact@v4 @@ -177,22 +171,12 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v4 - - # #debugging - # - name: Setup ssh session - # uses: Warpbuilds/action-debugger@v1.3 - - name: Run coverage on one file - run: | - coverage report --data-file=coverage_test_components.py/.coverage - name: Run coverage run: | coverage combine --keep coverage*/.coverage* coverage report coverage xml - - name: show directory - run: ls -la - - uses: codecov/codecov-action@v3 with: files: coverage.xml From bcaef36b44b21107226854b65bea1c3dbc304893 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 09:19:26 +0100 Subject: [PATCH 109/117] run some template variations on github --- .github/workflows/create-test-lint-wf-template.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 94cd4d8663..4e1997d22d 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -31,6 +31,12 @@ jobs: - "template_skip_igenomes.yml" - "template_skip_ci.yml" # - "template_skip_nf_core_configs.yml" + runner: ["self-hosted"] + include: + - TEMPLATE: "template_skip_all.yml" + runner: ubuntu-latest + - TEMPLATE: "template_skip_nf_core_configs.yml" + runner: ubuntu-latest steps: - name: go to working directory From 2f0698cb442aa17f027296fc75bad8bedf0ff590 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 09:21:55 +0100 Subject: [PATCH 110/117] remove more left over code --- .cirun.yml | 15 --------------- .../workflows/create-test-lint-wf-template.yml | 3 --- .github/workflows/create-test-wf.yml | 1 - requirements-dev.txt | 1 - 4 files changed, 20 deletions(-) delete mode 100644 .cirun.yml diff --git a/.cirun.yml b/.cirun.yml deleted file mode 100644 index 4b408b1d99..0000000000 --- a/.cirun.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Self-Hosted Github Action Runners on AWS via Cirun.io -# Reference: https://docs.cirun.io/reference/yaml -runners: - - name: "aws-runner" - # Cloud Provider: AWS - cloud: "aws" - instance_type: "t3a.large" - # Ubuntu-20.4, ami image - machine_image: "ami-0905a3c97561e0b69" - preemptible: false - region: "eu-west-1" - # Add this label in the "runs-on" param in .github/workflows/.yml - # So that this runner is created for running the workflow - labels: - - "cirun-aws-runner" diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 4e1997d22d..af8d306271 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -26,11 +26,9 @@ jobs: strategy: matrix: TEMPLATE: - # - "template_skip_all.yml" - "template_skip_github_badges.yml" - "template_skip_igenomes.yml" - "template_skip_ci.yml" - # - "template_skip_nf_core_configs.yml" runner: ["self-hosted"] include: - TEMPLATE: "template_skip_all.yml" @@ -108,7 +106,6 @@ jobs: run: | cd create-test-lint-wf nextflow run my-prefix-testpipeline -profile test,self_hosted_runner --outdir ./results - nextflow clean -f # Remove results folder before linting - name: remove results folder diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index de06df5817..c5f35b4d7b 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -56,7 +56,6 @@ jobs: export NXF_WORK=$(pwd) nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --plain nextflow run nf-core-testpipeline -profile test,self_hosted_runner --outdir ./results - nextflow clean -f - name: Upload log file artifact if: ${{ always() }} diff --git a/requirements-dev.txt b/requirements-dev.txt index dc3bf4f47d..6d890f0e1f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,6 @@ myst_parser pytest-cov pytest-datafiles -pytest-xdist responses Sphinx sphinx-rtd-theme From b4d3367d270f47d60be35e79cc7ece39c7a904b3 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 09:24:11 +0100 Subject: [PATCH 111/117] set correct runner --- .github/workflows/create-test-lint-wf-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index af8d306271..3fa81671ff 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -20,7 +20,7 @@ env: jobs: RunTestWorkflow: - runs-on: self-hosted + runs-on: ${{ matrix.runner }} env: NXF_ANSI_LOG: false strategy: From b00ec697999f19b1b8ee2d81b4d352e90caff9e6 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 09:27:29 +0100 Subject: [PATCH 112/117] set profile depending on runner --- .github/workflows/create-test-lint-wf-template.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 3fa81671ff..f8eb3e1e20 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -30,11 +30,14 @@ jobs: - "template_skip_igenomes.yml" - "template_skip_ci.yml" runner: ["self-hosted"] + profile: [",self_hosted_runner"] include: - TEMPLATE: "template_skip_all.yml" runner: ubuntu-latest + profile: "" - TEMPLATE: "template_skip_nf_core_configs.yml" runner: ubuntu-latest + profile: "" steps: - name: go to working directory @@ -105,7 +108,7 @@ jobs: - name: run the pipeline run: | cd create-test-lint-wf - nextflow run my-prefix-testpipeline -profile test,self_hosted_runner --outdir ./results + nextflow run my-prefix-testpipeline -profile test${{matrix.profile}} --outdir ./results # Remove results folder before linting - name: remove results folder From 2735ee883f72becc74ac848f751070670f9c4ce1 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 09:30:03 +0100 Subject: [PATCH 113/117] set profile docker for github runners --- .github/workflows/create-test-lint-wf-template.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index f8eb3e1e20..3c42464ce6 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -30,14 +30,14 @@ jobs: - "template_skip_igenomes.yml" - "template_skip_ci.yml" runner: ["self-hosted"] - profile: [",self_hosted_runner"] + profile: ["self_hosted_runner"] include: - TEMPLATE: "template_skip_all.yml" runner: ubuntu-latest - profile: "" + profile: "docker" - TEMPLATE: "template_skip_nf_core_configs.yml" runner: ubuntu-latest - profile: "" + profile: "docker" steps: - name: go to working directory @@ -108,7 +108,7 @@ jobs: - name: run the pipeline run: | cd create-test-lint-wf - nextflow run my-prefix-testpipeline -profile test${{matrix.profile}} --outdir ./results + nextflow run my-prefix-testpipeline -profile test,${{matrix.profile}} --outdir ./results # Remove results folder before linting - name: remove results folder From 8227bc3ee884af7b78cf7f4a03e26a729b0c290f Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 10:07:00 +0100 Subject: [PATCH 114/117] use pre-commit for all linting jobs --- .github/workflows/create-lint-wf.yml | 25 +------ .../create-test-lint-wf-template.yml | 19 +----- .github/workflows/fix-linting.yml | 24 ++----- .github/workflows/lint-code.yml | 1 - .pre-commit-config.yaml | 10 ++- .../.github/workflows/fix-linting.yml | 29 ++++----- .../.github/workflows/linting.yml | 65 ++----------------- .../pipeline-template/.pre-commit-config.yaml | 7 +- 8 files changed, 43 insertions(+), 137 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index cfd36385ea..989358694c 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -41,6 +41,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.11 + cache: pip - name: Install python dependencies run: | @@ -53,19 +54,6 @@ jobs: with: version: ${{ matrix.NXF_VER }} - # Install the Prettier linting tools - - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install Prettier and editorconfig-checker - run: npm install -g prettier editorconfig-checker - - - name: Install ruff - run: | - python -m pip install --upgrade pip - pip install ruff - # Build a pipeline from the template - name: nf-core create run: | @@ -84,15 +72,8 @@ jobs: working-directory: create-lint-wf # Run code style linting - - name: Run Prettier --check - run: prettier --check create-lint-wf/nf-core-testpipeline - - - name: Run Ruff check - run: ruff check create-lint-wf/nf-core-testpipeline - - name: Run Ruff format - run: ruff format create-lint-wf/nf-core-testpipeline - - name: Run ECLint check - run: editorconfig-checker -exclude README.md $(find nf-core-testpipeline/.* -type f | grep -v '.git\|.py\|md\|json\|yml\|yaml\|html\|css\|work\|.nextflow\|build\|nf_core.egg-info\|log.txt\|Makefile') + - name: run pre-commit + run: pre-commit run --all-files working-directory: create-lint-wf # Update modules to the latest version diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 3c42464ce6..843546fb35 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -64,18 +64,6 @@ jobs: with: version: latest-everything - # Install the Prettier linting tools - - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install Prettier - run: npm install -g prettier - - # Install the editorconfig linting tools - - name: Install editorconfig-checker - run: npm install -g editorconfig-checker - # Create template files - name: Create template skip all (except github) run: | @@ -120,11 +108,8 @@ jobs: run: nf-core --log-file log.txt sync --dir create-test-lint-wf/my-prefix-testpipeline/ # Run code style linting - - name: Run Prettier --check - run: prettier --check create-test-lint-wf/my-prefix-testpipeline - - - name: Run ECLint check - run: editorconfig-checker -exclude README.md $(find my-prefix-testpipeline/.* -type f | grep -v '.git\|.py\|md\|json\|yml\|yaml\|html\|css\|work\|.nextflow\|build\|nf_core.egg-info\|log.txt\|Makefile') + - name: Run pre-commit + run: pre-commit run --all-files working-directory: create-test-lint-wf # Remove TODO statements diff --git a/.github/workflows/fix-linting.yml b/.github/workflows/fix-linting.yml index b29ed26641..5e857e8dbb 100644 --- a/.github/workflows/fix-linting.yml +++ b/.github/workflows/fix-linting.yml @@ -24,29 +24,17 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }} - - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install Prettier - run: npm install -g prettier @prettier/plugin-php - - - name: Run 'prettier --write' - run: prettier --write ${GITHUB_WORKSPACE} - - name: Set up Python 3.11 uses: actions/setup-python@v5 with: python-version: 3.11 + cache: "pip" - - name: Install Ruff - run: | - python -m pip install --upgrade pip - pip install ruff - - name: Run Ruff - run: | - ruff check --fix . - ruff format . + - name: Install pre-commit + run: pip install pre-commit + + - name: Run pre-commit + run: pre-commit run --all-files - name: Commit & push changes run: | diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index b002a705f5..d9847dd365 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -30,5 +30,4 @@ jobs: run: pip install pre-commit - name: Run pre-commit - id: prettier_status run: pre-commit run --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd51226d54..fb2a67bace 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,12 +6,18 @@ repos: args: [--fix, --exit-non-zero-on-fix] # sort imports and fix - id: ruff-format # formatter - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v2.7.1" + rev: "v3.1.0" hooks: - id: prettier + - repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: "2.7.3" + hooks: + - id: editorconfig-checker + alias: ec + - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.8.0" # Use the sha / tag you want to point at + rev: "v1.8.0" hooks: - id: mypy additional_dependencies: diff --git a/nf_core/pipeline-template/.github/workflows/fix-linting.yml b/nf_core/pipeline-template/.github/workflows/fix-linting.yml index 31e8cd2b36..d9986bd30f 100644 --- a/nf_core/pipeline-template/.github/workflows/fix-linting.yml +++ b/nf_core/pipeline-template/.github/workflows/fix-linting.yml @@ -24,32 +24,25 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }} - - uses: actions/setup-node@v4 - - - name: Install Prettier - run: npm install -g prettier @prettier/plugin-php + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: 3.11 + cache: "pip" - # Check that we actually need to fix something - - name: Run 'prettier --check' - id: prettier_status - run: | - if prettier --check ${GITHUB_WORKSPACE}; then - echo "result=pass" >> $GITHUB_OUTPUT - else - echo "result=fail" >> $GITHUB_OUTPUT - fi + - name: Install pre-commit + run: pip install pre-commit - - name: Run 'prettier --write' - if: steps.prettier_status.outputs.result == 'fail' - run: prettier --write ${GITHUB_WORKSPACE} + - name: Run pre-commit + run: pre-commit run --all-files || echo "status=fail" >> $GITHUB_ENV - name: Commit & push changes - if: steps.prettier_status.outputs.result == 'fail' + if: env.status == 'fail' run: | git config user.email "core@nf-co.re" git config user.name "nf-core-bot" git config push.default upstream git add . git status - git commit -m "[automated] Fix linting with Prettier" + git commit -m "[automated] Fix linting with pre-commit" git push {%- endraw %} diff --git a/nf_core/pipeline-template/.github/workflows/linting.yml b/nf_core/pipeline-template/.github/workflows/linting.yml index acacb8aef3..fa332827b0 100644 --- a/nf_core/pipeline-template/.github/workflows/linting.yml +++ b/nf_core/pipeline-template/.github/workflows/linting.yml @@ -11,73 +11,22 @@ on: types: [published] jobs: - EditorConfig: + pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - - name: Install editorconfig-checker - run: npm install -g editorconfig-checker - - - name: Run ECLint check - run: editorconfig-checker -exclude README.md $(find .* -type f | grep -v '.git\|.py\|.md\|json\|yml\|yaml\|html\|css\|work\|.nextflow\|build\|nf_core.egg-info\|log.txt\|Makefile') - - Prettier: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - - - name: Install Prettier - run: npm install -g prettier - - - name: Run Prettier --check - run: prettier --check ${GITHUB_WORKSPACE} - - Ruff: - runs-on: ["self-hosted"] - steps: - - name: Check out source-code repository - uses: actions/checkout@v4 - - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 - - name: Install Ruff - run: | - python -m pip install --upgrade pip - pip install ruff - - name: Run Ruff check - run: ruff check . - - - name: Run Ruff format - run: ruff format . - - # If the above check failed, post a comment on the PR explaining the failure - - name: Post PR comment - if: failure() - uses: mshick/add-pr-comment@v2 - with: - message: | - ## Python linting (`ruff`) is failing - - To keep the code consistent with lots of contributors, we run automated code consistency checks. - To fix this CI test, please run: - - * Install [`ruff`](https://github.com/astral-sh/ruff): `pip install ruff` - * Fix formatting errors in your pipeline: `ruff check --fix .` and `ruff format .` - - Once you push these changes the test should pass, and you can hide this comment :+1: + cache: "pip" - We highly recommend setting up Ruff in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help! + - name: Install pre-commit + run: pip install pre-commit - Thanks again for your contribution! - repo-token: ${{ secrets.GITHUB_TOKEN }} - allow-repeats: false + - name: Run pre-commit + run: pre-commit run --all-files nf-core: runs-on: ubuntu-latest diff --git a/nf_core/pipeline-template/.pre-commit-config.yaml b/nf_core/pipeline-template/.pre-commit-config.yaml index 0c31cdb99f..984321ff26 100644 --- a/nf_core/pipeline-template/.pre-commit-config.yaml +++ b/nf_core/pipeline-template/.pre-commit-config.yaml @@ -1,5 +1,10 @@ repos: - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v2.7.1" + rev: "v3.1.1" hooks: - id: prettier + - repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: "2.7.3" + hooks: + - id: editorconfig-checker + alias: ec From cd75ff921d2e76ebcaa39cf632cd737dec39eca7 Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 10:07:16 +0100 Subject: [PATCH 115/117] fix editorconfig --- .editorconfig | 4 ++++ docs/api/Makefile | 4 ++-- nf_core/pipeline-template/.editorconfig | 8 ++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 014c2383bd..eaf7834976 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,7 @@ indent_style = space [*.{md,yml,yaml,html,css,scss,js,cff}] indent_size = 2 + +# ignore python and markdown files +[*.{py,md}] +indent_style = unset diff --git a/docs/api/Makefile b/docs/api/Makefile index f961e4ded1..69f3987065 100644 --- a/docs/api/Makefile +++ b/docs/api/Makefile @@ -9,11 +9,11 @@ BUILDDIR = _build # Put it first so that "make" without argument is like "make help". help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/nf_core/pipeline-template/.editorconfig b/nf_core/pipeline-template/.editorconfig index b6b3190776..9b990088ab 100644 --- a/nf_core/pipeline-template/.editorconfig +++ b/nf_core/pipeline-template/.editorconfig @@ -22,3 +22,11 @@ indent_size = unset [/assets/email*] indent_size = unset + +# ignore Readme +[README.md] +indent_style = unset + +# ignore python +[*.{py}] +indent_style = unset From c9377c450109466e8bd949a4be4e5be897adb33d Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 10:12:20 +0100 Subject: [PATCH 116/117] fix .editorconfig and makefile --- .editorconfig | 8 +++++++- docs/api/Makefile | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index eaf7834976..449f446a3b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,5 +12,11 @@ indent_style = space indent_size = 2 # ignore python and markdown files -[*.{py,md}] +[*.py] +indent_style = unset + +[**/{CONTRIBUTING,README}.md] +indent_style = unset + +[**/Makefile] indent_style = unset diff --git a/docs/api/Makefile b/docs/api/Makefile index 69f3987065..ab30a5051e 100644 --- a/docs/api/Makefile +++ b/docs/api/Makefile @@ -9,11 +9,11 @@ BUILDDIR = _build # Put it first so that "make" without argument is like "make help". help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) From 43d56d56159844c54706200d250d822766a99b6d Mon Sep 17 00:00:00 2001 From: mashehu Date: Fri, 5 Jan 2024 11:02:48 +0100 Subject: [PATCH 117/117] update changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c8f522fe4..2f18b559b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### Template +- Use `pre-commit` to lint files in GitHub CI ([#2635](https://github.com/nf-core/tools/pull/2635)) + ### Download ### Linting @@ -14,6 +16,8 @@ ### General +- Run CI-pytests for nf-core tools on self-hosted runners ([#2550](https://github.com/nf-core/tools/pull/2550)) + - Add Ruff linter and formatter replacing Black, isort and pyupgrade ([#2620](https://github.com/nf-core/tools/pull/2620)) - Update pre-commit hook pre-commit/mirrors-mypy to v1.8.0 ([#2630](https://github.com/nf-core/tools/pull/2630)) - Update mshick/add-pr-comment action to v2 ([#2632](https://github.com/nf-core/tools/pull/2632)) @@ -24,7 +28,6 @@ - Rename `release-announcments.yml` to `release-announcements.yml` ([#2610](https://github.com/nf-core/tools/pull/2610)) - Fix `nextflow.config` `docker.runOptions` ([#2607](https://github.com/nf-core/tools/pull/2607)) -- Use `pre-commit` to lint files in GitHub CI ([#2635](https://github.com/nf-core/tools/pull/2635)) ### General