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

Workflow for HDMF Dev compatibility #77

Merged
merged 34 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b6da5ed
Create validate_schema.yml
mavaylon1 Aug 25, 2023
df776c0
Update validate_schema.yml
mavaylon1 Aug 25, 2023
dcd1b11
Update validate_schema.yml
mavaylon1 Aug 25, 2023
2ddcc0d
Update validate_schema.yml
mavaylon1 Aug 25, 2023
a578034
Update namespace.yaml
mavaylon1 Aug 28, 2023
5bf0fef
Update conf.py
mavaylon1 Aug 28, 2023
0fb5dc6
Update hdmf_common_release_notes.rst
mavaylon1 Aug 28, 2023
5f9cbf9
Update namespace.yaml
mavaylon1 Aug 28, 2023
9154e41
Update conf.py
mavaylon1 Aug 28, 2023
36d0d97
Update namespace.yaml
mavaylon1 Aug 28, 2023
2dd3d21
Update hdmf_common_release_notes.rst
mavaylon1 Aug 28, 2023
64a28aa
Update hdmf_common_release_notes.rst
mavaylon1 Aug 28, 2023
e199926
Rename validate_schema.yml to hdmf_compatibility_schema.yml
mavaylon1 Sep 9, 2023
9f0ed7b
Create validate_schema.yaml
mavaylon1 Sep 9, 2023
1fe5a3e
Create hdmf-common.schema.json
mavaylon1 Sep 9, 2023
f73ab87
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
dd42bb4
Update validate_schema.yaml
mavaylon1 Sep 12, 2023
0ab5ed9
Update validate_schema.yaml
mavaylon1 Sep 12, 2023
9a1b061
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
f099e8b
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
82c6672
Update validate_schema.yaml
mavaylon1 Sep 12, 2023
2c173d4
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
150ad4f
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
a478b44
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
b99948a
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
af56adc
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
1089c4f
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
fb609e1
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
7417ee4
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
5a639b1
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
dcdf049
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
0cb6ecf
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
01f4503
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
0276ec7
Update hdmf_compatibility_schema.yml
mavaylon1 Sep 12, 2023
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
27 changes: 27 additions & 0 deletions .github/workflows/hdmf_compatibility_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check HDMF Dev Compatibility

on: [pull_request, workflow_dispatch]

jobs:
check_compatibility:
runs-on: ubuntu-latest
steps:
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }} # checkout branch
mavaylon1 marked this conversation as resolved.
Show resolved Hide resolved
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Clone HDMF and Run HDMF tests
run: |
git clone https://github.com/hdmf-dev/hdmf.git --recurse-submodules
cd hdmf
python -m pip install -r requirements-dev.txt -r requirements.txt
python -m pip install -e .
pytest tests/unit/common/
21 changes: 21 additions & 0 deletions .github/workflows/validate_schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Validate schema

on: [push, pull_request, workflow_dispatch]

jobs:
validate:
# run pipeline on either a push event or a PR event on a fork
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dev branch of HDMF
run: |
pip install git+https://github.com/hdmf-dev/hdmf.git
- name: Validate schema specification
run: |
validate_hdmf_spec common -m hdmf-common.schema.json
280 changes: 280 additions & 0 deletions hdmf-common.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "hdmf-common.schema.json",
"title": "Schema for the HDMF Common specification",
"description": "A schema for validating HDMF Common YAML Files",
"version": "1.8.0",
"type": "object",
"additionalProperties": false,
"properties": {
"groups": {"$ref": "#/definitions/groups"},
"attributes": {"$ref": "#/definitions/attributes"},
"datasets": {"$ref": "#/definitions/datasets"},
"links": {"$ref": "#/definitions/links"},
"namespaces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"version",
"author",
"contact"
],
"properties": {
"name": {"type": "string"},
"version": {"type": "string", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"},
"doc": {"type": "string"},
"author": {"type": "array", "items": {"type": "string"}},
"contact": {"type": "array", "items": {"type": "string", "format": "email"}},
"full_name": {"type": "string"},
"date": {"type": "string", "format": "date"},
"schema": {
"type": "array",
"items": {
"type": "object",
"oneOf": [
{"required": ["namespace"]},
{"required": ["source"]}
],
"properties": {
"namespace": {"type": "string"},
"doc": {"type": "string"},
"source": {"type": "string"},
"title": {"type": "string"},
"data_types": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
},
"definitions": {
"protectedString": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"quantity": {
"description": "Quantity marker",
"anyOf": [
{
"type": "integer",
"minimum": 1
},
{
"type": "string",
"enum": [
"*",
"?",
"+",
"zero_or_many",
"one_or_many",
"zero_or_one"
]
}
]
},
"flat_dtype": {
"description": "Required string describing the data type of the attribute",
"anyOf": [
{
"type": "string",
"enum": [
"float",
"float32",
"double",
"float64",
"long",
"int64",
"int",
"int32",
"int16",
"int8",
"uint",
"uint32",
"uint16",
"uint8",
"uint64",
"numeric",
"text",
"utf",
"utf8",
"utf-8",
"ascii",
"bool",
"isodatetime"
]
},
{"$ref": "#/definitions/ref_dtype"}
]
},
"dtype": {
"anyOf": [
{"$ref": "#/definitions/flat_dtype"},
{"$ref": "#/definitions/compound_dtype"}
]
},
"dims": {
"description": "Optional list describing the names of the dimensions of the data array stored by the attribute (default=None)",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{
"type": "array",
"items": {"type": "string"}
}
]
}
},
"shape": {
"description": "Optional list describing the allowed shape(s) of the data array stored by the attribute (default=None)",
"anyOf": [
{"$ref": "#/definitions/shape_spec"},
{
"type": "array",
"items": {"$ref": "#/definitions/shape_spec"}
}
]
},
"shape_spec": {
"type": "array",
"items": {
"anyOf": [
{
"type": "integer",
"minimum": 1
},
{
"value": null
}
]
}
},
"ref_dtype": {
"type": "object",
"required": ["target_type", "reftype"],
"properties": {
"target_type": {
"description": "Describes the data_type of the target that the reference points to",
"type": "string"
},
"reftype": {
"description": "describes the kind of reference",
"type": "string",
"enum": ["ref", "reference", "object", "region"]
}
}
},
"compound_dtype": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "doc", "dtype"],
"properties": {
"name": {"$ref": "#/definitions/protectedString"},
"doc": {"type": "string"},
"dtype": {"$ref": "#/definitions/flat_dtype"}
}
}
},
"groups": {
"description": "list of groups",
"type": "array",
"items": {
"title": "group",
"type": "object",
"required": ["doc"],
"additionalProperties": false,
"anyOf":[
{"required": ["data_type_def"]},
{"required": ["data_type_inc"]},
{"required": ["name"]}
],
"properties": {
"name": {"$ref": "#/definitions/protectedString"},
"default_name": {"$ref": "#/definitions/protectedString"},
"doc": {"type": "string"},
"data_type_def": {"$ref": "#/definitions/protectedString"},
"data_type_inc": {"$ref": "#/definitions/protectedString"},
"quantity": {"$ref": "#/definitions/quantity"},
"linkable": {"type": "boolean"},
"datasets": {"$ref": "#/definitions/datasets"},
"links": {"$ref": "#/definitions/links"},
"groups": {"$ref": "#/definitions/groups"},
"attributes": {"$ref": "#/definitions/attributes"}
}
}
},
"attributes": {
"type": "array",
"items": {
"title": "attribute",
"type": "object",
"required": ["doc"],
"additionalProperties": false,
"properties": {
"dtype": {"$ref": "#/definitions/dtype"},
"dims": {"$ref": "#/definitions/dims"},
"shape": {"$ref": "#/definitions/shape"},
"name": {"type": "string"},
"doc": {"type": "string"},
"required": {"type": "boolean"},
"value": {"description": "Optional constant, fixed value for the attribute."},
"default_value": {"description": "Optional default value for variable-valued attributes."}
}
}
},
"links": {
"type": "array",
"items": {
"title": "link",
"type": "object",
"required": ["target_type", "doc"],
"additionalProperties": false,
"properties": {
"name": {"type": "string"},
"doc": {"type": "string"},
"target_type": {"type": "string"},
"quantity": {"$ref": "#/definitions/quantity"}
}
}
},
"datasets": {
"type": "array",
"items": {
"title": "dataset",
"type": "object",
"required": ["doc"],
"additionalProperties": false,
"anyOf":[
{"required": ["data_type_def"]},
{"required": ["data_type_inc"]},
{"required": ["name"]}
],
"properties": {
"name": {"$ref": "#/definitions/protectedString"},
"default_name": {"$ref": "#/definitions/protectedString"},
"doc": {"type": "string"},
"dtype": {"$ref": "#/definitions/dtype"},
"dims": {"$ref": "#/definitions/dims"},
"shape": {"$ref": "#/definitions/shape"},
"data_type_def": {"$ref": "#/definitions/protectedString"},
"data_type_inc": {"$ref": "#/definitions/protectedString"},
"quantity": {"$ref": "#/definitions/quantity"},
"linkable": {"type": "boolean"},
"attributes": {"$ref": "#/definitions/attributes"},
"value": {"description": "Optional constant, fixed value for the attribute."},
"default_value": {"description": "Optional default value for variable-valued attributes."}
}
}
}
}
}