Skip to content

Commit

Permalink
fixed prettier errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RobJY committed Nov 7, 2024
2 parents 31a28e7 + c7cc952 commit 5c65c21
Show file tree
Hide file tree
Showing 51 changed files with 998 additions and 974 deletions.
12 changes: 6 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you'd like to write some code for nf-core/mcmicro, the standard workflow is a
1. Check that there isn't already an issue about your idea in the [nf-core/mcmicro issues](https://github.com/nf-core/mcmicro/issues) to avoid duplicating work. If there isn't one already, please create one so that others know you're working on this
2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [nf-core/mcmicro repository](https://github.com/nf-core/mcmicro) to your GitHub account
3. Make the necessary changes / additions within your forked repository following [Pipeline conventions](#pipeline-contribution-conventions)
4. Use `nf-core schema build` and add any new parameters to the pipeline JSON schema (requires [nf-core tools](https://github.com/nf-core/tools) >= 1.10).
4. Use `nf-core pipelines schema build` and add any new parameters to the pipeline JSON schema (requires [nf-core tools](https://github.com/nf-core/tools) >= 1.10).
5. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged

If you're not used to this workflow with git, you can start with some [docs from GitHub](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests) or even their [excellent `git` resources](https://try.github.io/).
Expand All @@ -40,7 +40,7 @@ There are typically two types of tests that run:
### Lint tests

`nf-core` has a [set of guidelines](https://nf-co.re/developers/guidelines) which all pipelines must adhere to.
To enforce these and ensure that all pipelines stay in sync, we have developed a helper tool which runs checks on the pipeline code. This is in the [nf-core/tools repository](https://github.com/nf-core/tools) and once installed can be run locally with the `nf-core lint <pipeline-directory>` command.
To enforce these and ensure that all pipelines stay in sync, we have developed a helper tool which runs checks on the pipeline code. This is in the [nf-core/tools repository](https://github.com/nf-core/tools) and once installed can be run locally with the `nf-core pipelines lint <pipeline-directory>` command.

If any failures or warnings are encountered, please follow the listed URL for more documentation.

Expand Down Expand Up @@ -75,7 +75,7 @@ If you wish to contribute a new step, please use the following coding standards:
2. Write the process block (see below).
3. Define the output channel if needed (see below).
4. Add any new parameters to `nextflow.config` with a default (see below).
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core schema build` tool).
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core pipelines schema build` tool).
6. Add sanity checks and validation for all relevant parameters.
7. Perform local tests to validate that the new code works as expected.
8. If applicable, add a new test command in `.github/workflow/ci.yml`.
Expand All @@ -86,11 +86,11 @@ If you wish to contribute a new step, please use the following coding standards:

Parameters should be initialised / defined with default values in `nextflow.config` under the `params` scope.

Once there, use `nf-core schema build` to add to `nextflow_schema.json`.
Once there, use `nf-core pipelines schema build` to add to `nextflow_schema.json`.

### Default processes resource requirements

Sensible defaults for process resource requirements (CPUs / memory / time) for a process should be defined in `conf/base.config`. These should generally be specified generic with `withLabel:` selectors so they can be shared across multiple processes/steps of the pipeline. A nf-core standard set of labels that should be followed where possible can be seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/master/nf_core/pipeline-template/conf/base.config), which has the default process as a single core-process, and then different levels of multi-core configurations for increasingly large memory requirements defined with standardised labels.
Sensible defaults for process resource requirements (CPUs / memory / time) for a process should be defined in `conf/base.config`. These should generally be specified generic with `withLabel:` selectors so they can be shared across multiple processes/steps of the pipeline. A nf-core standard set of labels that should be followed where possible can be seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/main/nf_core/pipeline-template/conf/base.config), which has the default process as a single core-process, and then different levels of multi-core configurations for increasingly large memory requirements defined with standardised labels.

The process resources can be passed on to the tool dynamically within the process with the `${task.cpus}` and `${task.memory}` variables in the `script:` block.

Expand All @@ -103,7 +103,7 @@ Please use the following naming schemes, to make it easy to understand what is g

### Nextflow version bumping

If you are using a new feature from core Nextflow, you may bump the minimum required version of nextflow in the pipeline with: `nf-core bump-version --nextflow . [min-nf-version]`
If you are using a new feature from core Nextflow, you may bump the minimum required version of nextflow in the pipeline with: `nf-core pipelines bump-version --nextflow . [min-nf-version]`

### Images and figures

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/mcmi
- [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/mcmicro/tree/master/.github/CONTRIBUTING.md)
- [ ] If necessary, also make a PR on the nf-core/mcmicro _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
- [ ] Make sure your code lints (`nf-core lint`).
- [ ] Make sure your code lints (`nf-core pipelines lint`).
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir <OUTDIR>`).
- [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir <OUTDIR>`).
- [ ] Usage Documentation in `docs/usage.md` is updated.
Expand Down
25 changes: 21 additions & 4 deletions .github/workflows/awsfulltest.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
name: nf-core AWS full size tests
# This workflow is triggered on published releases.
# This workflow is triggered on PRs opened against the master branch.
# It can be additionally triggered manually with GitHub actions workflow dispatch button.
# It runs the -profile 'test_full' on AWS batch

on:
release:
types: [published]
pull_request:
branches:
- master
workflow_dispatch:
pull_request_review:
types: [submitted]

jobs:
run-platform:
name: Run AWS full tests
if: github.repository == 'nf-core/mcmicro'
# run only if the PR is approved by at least 2 reviewers and against the master branch or manually triggered
if: github.repository == 'nf-core/mcmicro' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: octokit/request-action@v2.x
id: check_approvals
with:
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: test_variables
if: github.event_name != 'workflow_dispatch'
run: |
JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}'
CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length')
test $CURRENT_APPROVALS_COUNT -ge 2 || exit 1 # At least 2 approvals are required
- name: Launch workflow via Seqera Platform
uses: seqeralabs/action-tower-launch@v2
# TODO nf-core: You can customise AWS full pipeline tests as required
Expand Down
241 changes: 125 additions & 116 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ concurrency:
cancel-in-progress: true

jobs:

nf-test-changes:
name: Check for changes
runs-on: ubuntu-latest
Expand Down Expand Up @@ -51,7 +50,8 @@ jobs:
test:
name: "Run tests (${{ matrix.nf_test_files }} ${{ matrix.profile }} NF-${{ matrix.NXF_VER }})"
needs: [nf-test-changes]
if: needs.nf-test-changes.outputs.nf_test_files != '[]'
# Only run on push if this is the nf-core dev branch (merged PRs)
if: "${{ (github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/mcmicro')) && needs.nf-test-changes.outputs.nf_test_files != '[]' }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -63,9 +63,18 @@ jobs:
profile:
# - "conda"
- "docker"
# - "singularity"
- "singularity"
test_name:
- "test"
isMaster:
- ${{ github.base_ref == 'master' }}
# Exclude conda and singularity on dev
exclude:
- isMaster: false
profile: "conda"
- isMaster: false
profile: "singularity"
steps:

- name: install curl
run: sudo apt update && sudo apt install -y curl wget

Expand All @@ -77,123 +86,123 @@ jobs:
with:
version: "${{ matrix.NXF_VER }}"

# - name: Set up Apptainer
# if: matrix.profile == 'singularity'
# uses: eWaterCycle/setup-apptainer@main

# - name: Set up Singularity
# if: matrix.profile == 'singularity'
# run: |
# mkdir -p $NXF_SINGULARITY_CACHEDIR
# mkdir -p $NXF_SINGULARITY_LIBRARYDIR

# - name: Set up Miniconda
# if: matrix.profile == 'conda'
# uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3
# with:
# miniconda-version: "latest"
# auto-update-conda: true
# conda-solver: libmamba
# channels: conda-forge,bioconda

# - name: Set up Conda
# if: matrix.profile == 'conda'
# run: |
# echo $(realpath $CONDA)/condabin >> $GITHUB_PATH
# echo $(realpath python) >> $GITHUB_PATH

- name: Install nf-test
uses: nf-core/setup-nf-test@v1
with:
version: ${{ env.NFT_VER }}
- name: Set up Apptainer
if: matrix.profile == 'singularity'
uses: eWaterCycle/setup-apptainer@main

- uses: actions/setup-python@v4
with:
python-version: "3.11"
architecture: "x64"

- name: Install pdiff to see diff between nf-test snapshots
- name: Set up Singularity
if: matrix.profile == 'singularity'
run: |
python -m pip install --upgrade pip
pip install pdiff
- name: Clean up Disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Run nf-test
run: |
nf-test test \
--verbose ${{ matrix.nf_test_files }} \
--profile "+${{ matrix.profile }},ci" \
--junitxml=test.xml \
--tap=test.tap
- uses: pcolby/tap-summary@v1
mkdir -p $NXF_SINGULARITY_CACHEDIR
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
# - name: Set up Miniconda
# if: matrix.profile == 'conda'
# uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3
# with:
# miniconda-version: "latest"
# auto-update-conda: true
# conda-solver: libmamba
# channels: conda-forge,bioconda

# - name: Set up Conda
# if: matrix.profile == 'conda'
# run: |
# echo $(realpath $CONDA)/condabin >> $GITHUB_PATH
# echo $(realpath python) >> $GITHUB_PATH

# - name: Install nf-test
# uses: nf-core/setup-nf-test@v1
# with:
# version: ${{ env.NFT_VER }}
#
# - uses: actions/setup-python@v4
# with:
# python-version: "3.11"
# architecture: "x64"
#
# - name: Install pdiff to see diff between nf-test snapshots
# run: |
# python -m pip install --upgrade pip
# pip install pdiff
#
# - name: Clean up Disk space
# uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
#
# - name: Run nf-test
# run: |
# nf-test test \
# --verbose ${{ matrix.nf_test_files }} \
# --profile "+${{ matrix.profile }},ci" \
# --junitxml=test.xml \
# --tap=test.tap
#
# - uses: pcolby/tap-summary@v1
# with:
# path: >-
# test.tap
#
# - name: Output log on failure
# if: failure()
# run: |
# sudo apt install bat > /dev/null
# batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/meta/nextflow.log
#
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v3
# if: always() # always run even if the previous step fails
# with:
# report_paths: test.xml

# confirm-pass:
# runs-on: ubuntu-latest
# needs: [test]
# if: always()
# steps:
# - name: All tests ok
# if: ${{ !contains(needs.*.result, 'failure') }}
# run: exit 0
# - name: One or more tests failed
# if: ${{ contains(needs.*.result, 'failure') }}
# run: exit 1
#
# - name: debug-print
# if: always()
# run: |
# echo "toJSON(needs) = ${{ toJSON(needs) }}"
# echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"

test_orig:
name: Run pipeline with test data
# Only run on push if this is the nf-core dev branch (merged PRs)
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/mcmicro') }}"
runs-on: ubuntu-latest
strategy:
matrix:
NXF_VER:
- "23.04.0"
- "latest-everything"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
path: >-
test.tap
distribution: "zulu" # See 'Supported distributions' for available options
java-version: "21"

- name: Output log on failure
if: failure()
run: |
sudo apt install bat > /dev/null
batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/meta/nextflow.log
- name: Check out pipeline code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
- name: Install Nextflow
uses: nf-core/setup-nextflow@v2
with:
report_paths: test.xml
version: "${{ matrix.NXF_VER }}"

confirm-pass:
runs-on: ubuntu-latest
needs: [test]
if: always()
steps:
- name: All tests ok
if: ${{ !contains(needs.*.result, 'failure') }}
run: exit 0
- name: One or more tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

- name: debug-print
if: always()
- name: Disk space cleanup
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Run pipeline with test data
# TODO nf-core: You can customise CI pipeline run tests as required
# For example: adding multiple test runs with different parameters
# Remember that you can parallelise this by using strategy.matrix
run: |
echo "toJSON(needs) = ${{ toJSON(needs) }}"
echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"
# test_orig:
# name: Run pipeline with test data
# # Only run on push if this is the nf-core dev branch (merged PRs)
# if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/mcmicro') }}"
# runs-on: ubuntu-latest
# strategy:
# matrix:
# NXF_VER:
# - "23.04.0"
# - "latest-everything"
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-java@v4
# with:
# distribution: 'zulu' # See 'Supported distributions' for available options
# java-version: '21'
#
# - name: Check out pipeline code
# uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
#
# - name: Install Nextflow
# uses: nf-core/setup-nextflow@v2
# with:
# version: "${{ matrix.NXF_VER }}"
#
# - name: Disk space cleanup
# uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
#
# - name: Run pipeline with test data
# # TODO nf-core: You can customise CI pipeline run tests as required
# # For example: adding multiple test runs with different parameters
# # Remember that you can parallelise this by using strategy.matrix
# run: |
# nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results
Loading

0 comments on commit 5c65c21

Please sign in to comment.