Skip to content

Commit 0a52776

Browse files
authored
Merge pull request #71 from nf-core/nf-core-template-merge-3.4.1
Important! Template update for nf-core/tools v3.4.1
2 parents 4b858cc + 755170d commit 0a52776

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1464
-392
lines changed

.devcontainer/devcontainer.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"name": "nfcore",
3-
"image": "nfcore/gitpod:latest",
4-
"remoteUser": "gitpod",
5-
"runArgs": ["--privileged"],
3+
"image": "nfcore/devcontainer:latest",
64

7-
// Configure tool-specific properties.
8-
"customizations": {
9-
// Configure properties specific to VS Code.
10-
"vscode": {
11-
// Set *default* container specific settings.json values on container create.
12-
"settings": {
13-
"python.defaultInterpreterPath": "/opt/conda/bin/python"
14-
},
5+
"remoteUser": "root",
6+
"privileged": true,
157

16-
// Add the IDs of extensions you want installed when the container is created.
17-
"extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"]
18-
}
8+
"remoteEnv": {
9+
// Workspace path on the host for mounting with docker-outside-of-docker
10+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
11+
},
12+
13+
"onCreateCommand": "./.devcontainer/setup.sh",
14+
15+
"hostRequirements": {
16+
"cpus": 4,
17+
"memory": "16gb",
18+
"storage": "32gb"
1919
}
2020
}

.devcontainer/setup.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# Customise the terminal command prompt
4+
echo "export PROMPT_DIRTRIM=2" >> $HOME/.bashrc
5+
echo "export PS1='\[\e[3;36m\]\w ->\[\e[0m\\] '" >> $HOME/.bashrc
6+
export PROMPT_DIRTRIM=2
7+
export PS1='\[\e[3;36m\]\w ->\[\e[0m\\] '
8+
9+
# Update Nextflow
10+
nextflow self-update
11+
12+
# Update welcome message
13+
echo "Welcome to the nf-core/methylong devcontainer!" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt

.editorconfig

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ If you wish to contribute a new step, please use the following coding standards:
7878
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core pipelines schema build` tool).
7979
6. Add sanity checks and validation for all relevant parameters.
8080
7. Perform local tests to validate that the new code works as expected.
81-
8. If applicable, add a new test command in `.github/workflow/ci.yml`.
81+
8. If applicable, add a new test in the `tests` directory.
8282
9. Update MultiQC config `assets/multiqc_config.yml` so relevant suffixes, file name clean up and module plots are in the appropriate order. If applicable, add a [MultiQC](https://https://multiqc.info/) module.
8383
10. Add a description of the output files and if relevant any appropriate images from the MultiQC report to `docs/output.md`.
8484

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Get number of shards"
2+
description: "Get the number of nf-test shards for the current CI job"
3+
inputs:
4+
max_shards:
5+
description: "Maximum number of shards allowed"
6+
required: true
7+
paths:
8+
description: "Component paths to test"
9+
required: false
10+
tags:
11+
description: "Tags to pass as argument for nf-test --tag parameter"
12+
required: false
13+
outputs:
14+
shard:
15+
description: "Array of shard numbers"
16+
value: ${{ steps.shards.outputs.shard }}
17+
total_shards:
18+
description: "Total number of shards"
19+
value: ${{ steps.shards.outputs.total_shards }}
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Install nf-test
24+
uses: nf-core/setup-nf-test@v1
25+
with:
26+
version: ${{ env.NFT_VER }}
27+
- name: Get number of shards
28+
id: shards
29+
shell: bash
30+
run: |
31+
# Run nf-test with dynamic parameter
32+
nftest_output=$(nf-test test \
33+
--profile +docker \
34+
$(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \
35+
--dry-run \
36+
--ci \
37+
--changed-since HEAD^) || {
38+
echo "nf-test command failed with exit code $?"
39+
echo "Full output: $nftest_output"
40+
exit 1
41+
}
42+
echo "nf-test dry-run output: $nftest_output"
43+
44+
# Default values for shard and total_shards
45+
shard="[]"
46+
total_shards=0
47+
48+
# Check if there are related tests
49+
if echo "$nftest_output" | grep -q 'No tests to execute'; then
50+
echo "No related tests found."
51+
else
52+
# Extract the number of related tests
53+
number_of_shards=$(echo "$nftest_output" | sed -n 's|.*Executed \([0-9]*\) tests.*|\1|p')
54+
if [[ -n "$number_of_shards" && "$number_of_shards" -gt 0 ]]; then
55+
shards_to_run=$(( $number_of_shards < ${{ inputs.max_shards }} ? $number_of_shards : ${{ inputs.max_shards }} ))
56+
shard=$(seq 1 "$shards_to_run" | jq -R . | jq -c -s .)
57+
total_shards="$shards_to_run"
58+
else
59+
echo "Unexpected output format. Falling back to default values."
60+
fi
61+
fi
62+
63+
# Write to GitHub Actions outputs
64+
echo "shard=$shard" >> $GITHUB_OUTPUT
65+
echo "total_shards=$total_shards" >> $GITHUB_OUTPUT
66+
67+
# Debugging output
68+
echo "Final shard array: $shard"
69+
echo "Total number of shards: $total_shards"

.github/actions/nf-test/action.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: "nf-test Action"
2+
description: "Runs nf-test with common setup steps"
3+
inputs:
4+
profile:
5+
description: "Profile to use"
6+
required: true
7+
shard:
8+
description: "Shard number for this CI job"
9+
required: true
10+
total_shards:
11+
description: "Total number of test shards(NOT the total number of matrix jobs)"
12+
required: true
13+
paths:
14+
description: "Test paths"
15+
required: true
16+
tags:
17+
description: "Tags to pass as argument for nf-test --tag parameter"
18+
required: false
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Setup Nextflow
23+
uses: nf-core/setup-nextflow@v2
24+
with:
25+
version: "${{ env.NXF_VERSION }}"
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
29+
with:
30+
python-version: "3.14"
31+
32+
- name: Install nf-test
33+
uses: nf-core/setup-nf-test@v1
34+
with:
35+
version: "${{ env.NFT_VER }}"
36+
install-pdiff: true
37+
38+
- name: Setup apptainer
39+
if: contains(inputs.profile, 'singularity')
40+
uses: eWaterCycle/setup-apptainer@main
41+
42+
- name: Set up Singularity
43+
if: contains(inputs.profile, 'singularity')
44+
shell: bash
45+
run: |
46+
mkdir -p $NXF_SINGULARITY_CACHEDIR
47+
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
48+
49+
- name: Conda setup
50+
if: contains(inputs.profile, 'conda')
51+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3
52+
with:
53+
auto-update-conda: true
54+
conda-solver: libmamba
55+
channels: conda-forge
56+
channel-priority: strict
57+
conda-remove-defaults: true
58+
59+
- name: Run nf-test
60+
shell: bash
61+
env:
62+
NFT_WORKDIR: ${{ env.NFT_WORKDIR }}
63+
run: |
64+
nf-test test \
65+
--profile=+${{ inputs.profile }} \
66+
$(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \
67+
--ci \
68+
--changed-since HEAD^ \
69+
--verbose \
70+
--tap=test.tap \
71+
--shard ${{ inputs.shard }}/${{ inputs.total_shards }}
72+
73+
# Save the absolute path of the test.tap file to the output
74+
echo "tap_file_path=$(realpath test.tap)" >> $GITHUB_OUTPUT
75+
76+
- name: Generate test summary
77+
if: always()
78+
shell: bash
79+
run: |
80+
# Add header if it doesn't exist (using a token file to track this)
81+
if [ ! -f ".summary_header" ]; then
82+
echo "# 🚀 nf-test results" >> $GITHUB_STEP_SUMMARY
83+
echo "" >> $GITHUB_STEP_SUMMARY
84+
echo "| Status | Test Name | Profile | Shard |" >> $GITHUB_STEP_SUMMARY
85+
echo "|:------:|-----------|---------|-------|" >> $GITHUB_STEP_SUMMARY
86+
touch .summary_header
87+
fi
88+
89+
if [ -f test.tap ]; then
90+
while IFS= read -r line; do
91+
if [[ $line =~ ^ok ]]; then
92+
test_name="${line#ok }"
93+
# Remove the test number from the beginning
94+
test_name="${test_name#* }"
95+
echo "| ✅ | ${test_name} | ${{ inputs.profile }} | ${{ inputs.shard }}/${{ inputs.total_shards }} |" >> $GITHUB_STEP_SUMMARY
96+
elif [[ $line =~ ^not\ ok ]]; then
97+
test_name="${line#not ok }"
98+
# Remove the test number from the beginning
99+
test_name="${test_name#* }"
100+
echo "| ❌ | ${test_name} | ${{ inputs.profile }} | ${{ inputs.shard }}/${{ inputs.total_shards }} |" >> $GITHUB_STEP_SUMMARY
101+
fi
102+
done < test.tap
103+
else
104+
echo "| ⚠️ | No test results found | ${{ inputs.profile }} | ${{ inputs.shard }}/${{ inputs.total_shards }} |" >> $GITHUB_STEP_SUMMARY
105+
fi
106+
107+
- name: Clean up
108+
if: always()
109+
shell: bash
110+
run: |
111+
sudo rm -rf /home/ubuntu/tests/

.github/workflows/awsfulltest.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
run-platform:
1515
name: Run AWS full tests
1616
# run only if the PR is approved by at least 2 reviewers and against the master/main branch or manually triggered
17-
if: github.repository == 'nf-core/methylong' && github.event.review.state == 'approved' && (github.event.pull_request.base.ref == 'master' || github.event.pull_request.base.ref == 'main') || github.event_name == 'workflow_dispatch'
17+
if: github.repository == 'nf-core/methylong' && github.event.review.state == 'approved' && (github.event.pull_request.base.ref == 'master' || github.event.pull_request.base.ref == 'main') || github.event_name == 'workflow_dispatch' || github.event_name == 'release'
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Set revision variable
@@ -28,20 +28,21 @@ jobs:
2828
# Add full size test data (but still relatively small datasets for few samples)
2929
# on the `test_full.config` test runs with only one set of parameters
3030
with:
31-
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
31+
workspace_id: ${{ vars.TOWER_WORKSPACE_ID }}
3232
access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}
33-
compute_env: ${{ secrets.TOWER_COMPUTE_ENV }}
33+
compute_env: ${{ vars.TOWER_COMPUTE_ENV }}
3434
revision: ${{ steps.revision.outputs.revision }}
35-
workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/methylong/work-${{ steps.revision.outputs.revision }}
35+
workdir: s3://${{ vars.AWS_S3_BUCKET }}/work/methylong/work-${{ steps.revision.outputs.revision }}
3636
parameters: |
3737
{
3838
"hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}",
39-
"outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/methylong/results-${{ steps.revision.outputs.revision }}"
39+
"outdir": "s3://${{ vars.AWS_S3_BUCKET }}/methylong/results-${{ steps.revision.outputs.revision }}"
4040
}
4141
profiles: test_full
42-
- uses: actions/upload-artifact@v4
42+
43+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
4344
with:
4445
name: Seqera Platform debug log file
4546
path: |
46-
seqera_platform_action_*.log
47-
seqera_platform_action_*.json
47+
tower_action_*.log
48+
tower_action_*.json

.github/workflows/awstest.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ jobs:
1414
- name: Launch workflow via Seqera Platform
1515
uses: seqeralabs/action-tower-launch@v2
1616
with:
17-
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
17+
workspace_id: ${{ vars.TOWER_WORKSPACE_ID }}
1818
access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}
19-
compute_env: ${{ secrets.TOWER_COMPUTE_ENV }}
19+
compute_env: ${{ vars.TOWER_COMPUTE_ENV }}
2020
revision: ${{ github.sha }}
21-
workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/methylong/work-${{ github.sha }}
21+
workdir: s3://${{ vars.AWS_S3_BUCKET }}/work/methylong/work-${{ github.sha }}
2222
parameters: |
2323
{
24-
"outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/methylong/results-test-${{ github.sha }}"
24+
"outdir": "s3://${{ vars.AWS_S3_BUCKET }}/methylong/results-test-${{ github.sha }}"
2525
}
2626
profiles: test_aws_small
2727

28-
- uses: actions/upload-artifact@v4
28+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
2929
with:
3030
name: Seqera Platform debug log file
3131
path: |
32-
seqera_platform_action_*.log
33-
seqera_platform_action_*.json
32+
tower_action_*.log
33+
tower_action_*.json

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
matrix:
3131
NXF_VER:
32-
- "24.04.2"
32+
- "25.04.0"
3333
- "latest-everything"
3434
PARAMETERS:
3535
- "--bedgraph"

.github/workflows/clean-up.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
issues: write
1111
pull-requests: write
1212
steps:
13-
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
13+
- uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10
1414
with:
1515
stale-issue-message: "This issue has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment otherwise this issue will be closed in 20 days."
1616
stale-pr-message: "This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful."

0 commit comments

Comments
 (0)