Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test.yml specifically verify markdown part with new schema associated with modules #151

Merged
merged 5 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/gitbook-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ jobs:
echo "${MD_NAME}"
- name: Download convertor from yml to md
run: |
curl -o ${{ github.workspace }}/yaml_to_md.py https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.1/yaml_to_md.py
curl -o ${{ github.workspace }}/requirements.txt https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.1/requirements.txt
curl -o ${{ github.workspace }}/yaml_to_md.py https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.2/yaml_to_md.py
curl -o ${{ github.workspace }}/requirements.txt https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.2/requirements.txt
- name: Give convertor permissions
run: chmod +x yaml_to_md.py
- name: Install python packages
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
- name: Run convertor to generate md file for new module
run: |
echo ${{ matrix.tags }}
python ${{ github.workspace }}/yaml_to_md.py all --yaml-file ${{ github.workspace }}/temp.yml --output-file ./${{ env.FEATURE_TYPE }}/${{ env.MD_NAME }}.md --schema-url https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.1/nextflow_schema/${{ env.FEATURE_TYPE }}/meta-schema.json ${{ env.SUBWORKFLOW }}
python ${{ github.workspace }}/yaml_to_md.py all --yaml-file ${{ github.workspace }}/temp.yml --output-file ./${{ env.FEATURE_TYPE }}/${{ env.MD_NAME }}.md --schema-url https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.2/nextflow_schema/${{ env.FEATURE_TYPE }}/meta-schema.json ${{ env.SUBWORKFLOW }}
- name: Check file existence for modules
id: check_files
uses: andstor/file-existence-action@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ jobs:
python-version: "3.10"
- name: Download convertor from yml to md
run: |
curl -o ${{ github.workspace }}/yaml_to_md.py https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.1/yaml_to_md.py
curl -o ${{ github.workspace }}/requirements.txt https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.1/requirements.txt
curl -o ${{ github.workspace }}/yaml_to_md.py https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.2/yaml_to_md.py
curl -o ${{ github.workspace }}/requirements.txt https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.2/requirements.txt
- name: Give convertor permissions
run: chmod +x yaml_to_md.py
- name: Install python packages
Expand Down Expand Up @@ -227,7 +227,7 @@ jobs:
run: |
echo ${{ matrix.tags }}
echo ${{ env.FEATURE_TYPE }}
python ${{ github.workspace }}/yaml_to_md.py validate --yaml-file ${{ github.workspace }}/temp.yml --schema-url https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.1/nextflow_schema/${{ env.FEATURE_TYPE }}/meta-schema.json
python ${{ github.workspace }}/yaml_to_md.py validate --yaml-file ${{ github.workspace }}/temp.yml --schema-url https://raw.githubusercontent.com/mskcc-omics-workflows/yaml_to_md/0.0.2/nextflow_schema/${{ env.FEATURE_TYPE }}/meta-schema.json

pytest:
runs-on: ubuntu-latest
Expand Down
40 changes: 25 additions & 15 deletions modules/environment-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,39 @@
"description": "Validate the environment.yml file for an nf-core module",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the component, same as in the meta.yml"
},
"channels": {
"type": "array",
"items": [
{
"enum": ["conda-forge"]
},
{
"enum": ["bioconda"]
}
],
"items": {
"enum": ["bioconda", "conda-forge"]
},
"minItems": 2
},
"dependencies": {
"type": "array",
"items": {
"type": "string",
"pattern": "^.[^><]=[^><].$"
"oneOf": [
{
"type": "string",
"pattern": "^.*[^><]=[^><].*$",
"$comment": "The above pattern ensures that all packages are pinned to a specific version. This ensures the reproducibility of the environment"
},
{
"type": "object",
"properties": {
"pip": {
"type": "array",
"items": {
"type": "string",
"pattern": "^.*==.*$",
"$comment": "The above pattern ensures that all packages are pinned to a specific version. This ensures the reproducibility of the environment"
}
}
}
}
]
}
}
},
"required": ["channels", "dependencies"]
"required": ["channels", "dependencies"],
"not": { "required": ["name"] }
}
178 changes: 79 additions & 99 deletions modules/meta-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,112 +38,16 @@
"type": "array",
"description": "Input channels for the module",
"items": {
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "Type of the input channel",
"enum": [
"map",
"file",
"directory",
"string",
"integer",
"float",
"boolean",
"list"
]
},
"description": {
"type": "string",
"description": "Description of the input channel"
},
"pattern": {
"type": "string",
"description": "Pattern of the input channel, given in Java glob syntax"
},
"default": {
"type": [
"string",
"number",
"boolean",
"array",
"object"
],
"description": "Default value for the input channel"
},
"enum": {
"type": "array",
"description": "List of allowed values for the input channel",
"items": {
"type": [
"string",
"number",
"boolean",
"array",
"object"
]
},
"uniqueItems": true
}
},
"required": ["type", "description"]
}
}
"type": "array",
"items": { "$ref": "#/definitions/elementProperties" }
}
},
"output": {
"type": "array",
"description": "Output channels for the module",
"items": {
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "Type of the output channel",
"enum": [
"map",
"file",
"directory",
"string",
"integer",
"float",
"boolean",
"list"
]
},
"description": {
"type": "string",
"description": "Description of the output channel"
},
"pattern": {
"type": "string",
"description": "Pattern of the input channel, given in Java glob syntax"
},
"enum": {
"type": "array",
"description": "List of allowed values for the output channel",
"items": {
"type": [
"string",
"number",
"boolean",
"array",
"object"
]
},
"uniqueItems": true
}
},
"required": ["type", "description"]
}
}
"items": { "$ref": "#/definitions/elementProperties" }
}
},
"tools": {
Expand Down Expand Up @@ -196,6 +100,19 @@
"minItems": 1,
"uniqueItems": true,
"message": "Licence must be an array of one or more entries, e.g. [\"MIT\"]"
},
"identifier": {
"description": "bio.tools identifier of the tool",
"anyOf": [
{
"type": "string",
"pattern": "^biotools:.*$"
},
{
"type": "string",
"maxLength": 0
}
]
}
},
"required": ["description"],
Expand All @@ -218,6 +135,69 @@
}
}
},
"definitions": {
"elementProperties": {
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "Type of the channel element",
"enum": [
"map",
"file",
"directory",
"string",
"integer",
"float",
"boolean",
"list"
]
},
"description": {
"type": "string",
"description": "Description of the channel"
},
"pattern": {
"type": "string",
"description": "Pattern of the channel, given in Java glob syntax"
},
"enum": {
"type": "array",
"description": "List of allowed values for the channel",
"items": {
"type": [
"string",
"number",
"boolean",
"array",
"object"
]
},
"uniqueItems": true
},
"ontologies": {
"type": "array",
"description": "List of ontologies for the channel",
"uniqueItems": true,
"items": {
"type": "object",
"patternProperties": {
".*": {
"type": "string",
"pattern": "^(http|https)://.*"
}
}
}
}
},
"required": ["type", "description"]
}
}
}
},
"required": [
"name",
"description",
Expand Down
Loading