Skip to content

Commit 382d936

Browse files
authored
Merge pull request #71 from nf-core/dev
First pipeline release
2 parents d74ee16 + bf1bee7 commit 382d936

142 files changed

Lines changed: 7295 additions & 2125 deletions

File tree

Some content is hidden

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

.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/proteinannotator 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

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/prot
1818
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/proteinannotator/tree/master/.github/CONTRIBUTING.md)
1919
- [ ] If necessary, also make a PR on the nf-core/proteinannotator _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
2020
- [ ] Make sure your code lints (`nf-core pipelines lint`).
21-
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir <OUTDIR>`).
22-
- [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir <OUTDIR>`).
21+
- [ ] Ensure the test suite passes (e.g. `nf-test test */local --profile=~test,docker` for all new local tests).
22+
- [ ] Check for unexpected warnings in debug mode (`nf-test test */local --profile=~test,docker,debug`).
2323
- [ ] Usage Documentation in `docs/usage.md` is updated.
2424
- [ ] Output Documentation in `docs/output.md` is updated.
2525
- [ ] `CHANGELOG.md` is updated.
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: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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: Print Modules Folder Tree
23+
uses: jaywcjlove/github-action-folder-tree@main
24+
with:
25+
exclude: "node_modules|dist|.git|.husky"
26+
path: ./modules
27+
depth: 10
28+
- name: Print Subworkflows Folder Tree
29+
uses: jaywcjlove/github-action-folder-tree@main
30+
with:
31+
exclude: "node_modules|dist|.git|.husky"
32+
path: ./subworkflows
33+
depth: 10
34+
- name: Setup Nextflow
35+
uses: nf-core/setup-nextflow@v2
36+
with:
37+
version: "${{ env.NXF_VERSION }}"
38+
39+
- name: Set up Python
40+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
41+
with:
42+
python-version: "3.14"
43+
44+
- name: Install nf-test
45+
uses: nf-core/setup-nf-test@v1
46+
with:
47+
version: "${{ env.NFT_VER }}"
48+
install-pdiff: true
49+
50+
- name: Setup apptainer
51+
if: contains(inputs.profile, 'singularity')
52+
uses: eWaterCycle/setup-apptainer@main
53+
54+
- name: Set up Singularity
55+
if: contains(inputs.profile, 'singularity')
56+
shell: bash
57+
run: |
58+
mkdir -p $NXF_SINGULARITY_CACHEDIR
59+
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
60+
61+
- name: Conda setup
62+
if: contains(inputs.profile, 'conda')
63+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3
64+
with:
65+
auto-update-conda: true
66+
conda-solver: libmamba
67+
channels: conda-forge
68+
channel-priority: strict
69+
conda-remove-defaults: true
70+
71+
- name: Run nf-test
72+
shell: bash
73+
env:
74+
NFT_WORKDIR: ${{ env.NFT_WORKDIR }}
75+
run: |
76+
nf-test test \
77+
--profile=+${{ inputs.profile }} \
78+
$(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \
79+
--ci \
80+
--changed-since HEAD^ \
81+
--verbose \
82+
--tap=test.tap \
83+
--shard ${{ inputs.shard }}/${{ inputs.total_shards }}
84+
85+
# Save the absolute path of the test.tap file to the output
86+
echo "tap_file_path=$(realpath test.tap)" >> $GITHUB_OUTPUT
87+
88+
- name: Generate test summary
89+
if: always()
90+
shell: bash
91+
run: |
92+
# Add header if it doesn't exist (using a token file to track this)
93+
if [ ! -f ".summary_header" ]; then
94+
echo "# 🚀 nf-test results" >> $GITHUB_STEP_SUMMARY
95+
echo "" >> $GITHUB_STEP_SUMMARY
96+
echo "| Status | Test Name | Profile | Shard |" >> $GITHUB_STEP_SUMMARY
97+
echo "|:------:|-----------|---------|-------|" >> $GITHUB_STEP_SUMMARY
98+
touch .summary_header
99+
fi
100+
101+
if [ -f test.tap ]; then
102+
while IFS= read -r line; do
103+
if [[ $line =~ ^ok ]]; then
104+
test_name="${line#ok }"
105+
# Remove the test number from the beginning
106+
test_name="${test_name#* }"
107+
echo "| ✅ | ${test_name} | ${{ inputs.profile }} | ${{ inputs.shard }}/${{ inputs.total_shards }} |" >> $GITHUB_STEP_SUMMARY
108+
elif [[ $line =~ ^not\ ok ]]; then
109+
test_name="${line#not ok }"
110+
# Remove the test number from the beginning
111+
test_name="${test_name#* }"
112+
echo "| ❌ | ${test_name} | ${{ inputs.profile }} | ${{ inputs.shard }}/${{ inputs.total_shards }} |" >> $GITHUB_STEP_SUMMARY
113+
fi
114+
done < test.tap
115+
else
116+
echo "| ⚠️ | No test results found | ${{ inputs.profile }} | ${{ inputs.shard }}/${{ inputs.total_shards }} |" >> $GITHUB_STEP_SUMMARY
117+
fi
118+
119+
- name: Clean up
120+
if: always()
121+
shell: bash
122+
run: |
123+
sudo rm -rf /home/ubuntu/tests/

.github/workflows/awsfulltest.yml

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,66 +4,42 @@ name: nf-core AWS full size tests
44
# It runs the -profile 'test_full' on AWS batch
55

66
on:
7-
pull_request:
8-
branches:
9-
- main
10-
- master
117
workflow_dispatch:
128
pull_request_review:
139
types: [submitted]
10+
release:
11+
types: [published]
1412

1513
jobs:
1614
run-platform:
1715
name: Run AWS full tests
18-
# run only if the PR is approved by at least 2 reviewers and against the master branch or manually triggered
19-
if: github.repository == 'nf-core/proteinannotator' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch'
16+
# 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/proteinannotator' && 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'
2018
runs-on: ubuntu-latest
2119
steps:
22-
- name: Get PR reviews
23-
uses: octokit/request-action@v2.x
24-
if: github.event_name != 'workflow_dispatch'
25-
id: check_approvals
26-
continue-on-error: true
27-
with:
28-
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews?per_page=100
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
32-
- name: Check for approvals
33-
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
34-
run: |
35-
echo "No review approvals found. At least 2 approvals are required to run this action automatically."
36-
exit 1
37-
38-
- name: Check for enough approvals (>=2)
39-
id: test_variables
40-
if: github.event_name != 'workflow_dispatch'
20+
- name: Set revision variable
21+
id: revision
4122
run: |
42-
JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}'
43-
CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length')
44-
test $CURRENT_APPROVALS_COUNT -ge 2 || exit 1 # At least 2 approvals are required
23+
echo "revision={%- raw -%}${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'release') && github.sha || 'dev' }}" >> "$GITHUB_OUTPUT"
4524
4625
- name: Launch workflow via Seqera Platform
4726
uses: seqeralabs/action-tower-launch@v2
48-
# TODO nf-core: You can customise AWS full pipeline tests as required
49-
# Add full size test data (but still relatively small datasets for few samples)
50-
# on the `test_full.config` test runs with only one set of parameters
5127
with:
52-
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
28+
workspace_id: ${{ vars.TOWER_WORKSPACE_ID }}
5329
access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}
54-
compute_env: ${{ secrets.TOWER_COMPUTE_ENV }}
55-
revision: ${{ github.sha }}
56-
workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/proteinannotator/work-${{ github.sha }}
30+
compute_env: ${{ vars.TOWER_COMPUTE_ENV }}
31+
revision: ${{ steps.revision.outputs.revision }}
32+
workdir: s3://${{ vars.AWS_S3_BUCKET }}/work/proteinannotator/work-${{ steps.revision.outputs.revision }}
5733
parameters: |
5834
{
5935
"hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}",
60-
"outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/proteinannotator/results-${{ github.sha }}"
36+
"outdir": "s3://${{ vars.AWS_S3_BUCKET }}/proteinannotator/results-${{ steps.revision.outputs.revision }}"
6137
}
6238
profiles: test_full
6339

64-
- uses: actions/upload-artifact@v4
40+
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
6541
with:
6642
name: Seqera Platform debug log file
6743
path: |
68-
seqera_platform_action_*.log
69-
seqera_platform_action_*.json
44+
tower_action_*.log
45+
tower_action_*.json

0 commit comments

Comments
 (0)