Skip to content

Commit

Permalink
add git diff check (#730)
Browse files Browse the repository at this point in the history
* add git diff check
  • Loading branch information
CagtayFabry authored Mar 28, 2022
1 parent 228554b commit af9df21
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 21 deletions.
26 changes: 25 additions & 1 deletion .github/workflows/pytest_asdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,33 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all tags and branches
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-python@v3
with:
python-version: '3.10'
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-
- name: pip installs
run: |
pip install -e .[test]
- name: run asdf schema pytest
run: |
pytest --asdf-tests --ignore=weldx/tests/ --no-cov weldx/schemas/
- name: check manifest diff
if: always()
run: |
cd ./devtools/scripts/
python ./update_manifest.py
- name: git diff
if: always()
run: |
git diff --color --exit-code
validate_manifest:
name: validate weldx manifest
Expand All @@ -32,9 +50,15 @@ jobs:
- uses: actions/setup-python@v3
with:
python-version: '3.10'
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-0
restore-keys: |
${{ runner.os }}-pip-
- name: pip installs
run: |
python -m pip install git+https://github.com/asdf-format/asdf.git
pip install asdf>=2.10
- uses: jannekem/run-python-script-action@v1
with:
script: |
Expand Down
5 changes: 3 additions & 2 deletions devtools/scripts/update_manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Update the manifest file with schema files found in this directory."""
from pathlib import Path

import yaml
Expand Down Expand Up @@ -31,7 +32,7 @@ def update_manifest(
if mapping["schema_uri"].startswith("http://stsci.edu/schemas")
]

schemas = Path(search_dir).rglob("*.yaml")
schemas = sorted(Path(search_dir).rglob("*.yaml"))

for schema in schemas:
content = yaml.load(
Expand All @@ -52,7 +53,7 @@ def update_manifest(
else:
print(f"No converter for URI: {schema}")

with open(Path(out), "w") as outfile:
with open(Path(out), "w") as outfile: # skipcq: PTC-W6004
outfile.write("%YAML 1.1\n---\n")
yaml.dump(
manifest,
Expand Down
36 changes: 18 additions & 18 deletions weldx/manifests/weldx-0.1.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ description: Manifest listing all tag URIs with schema URIs supported by weldx
tags:
- tag_uri: tag:stsci.edu:asdf/unit/quantity-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/unit/quantity-1.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/uuid-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/uuid-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/aws/design/base_metal-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/aws/design/base_metal-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/aws/design/connection-0.1.0
Expand All @@ -17,10 +15,10 @@ tags:
schema_uri: asdf://weldx.bam.de/weldx/schemas/aws/design/joint_penetration-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/aws/design/sub_assembly-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/aws/design/sub_assembly-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/aws/design/weldment-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/aws/design/weldment-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/aws/design/weld_details-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/aws/design/weld_details-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/aws/design/weldment-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/aws/design/weldment-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/aws/design/workpiece-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/aws/design/workpiece-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/aws/process/arc_welding_process-0.1.0
Expand All @@ -31,10 +29,10 @@ tags:
schema_uri: asdf://weldx.bam.de/weldx/schemas/aws/process/shielding_gas_for_procedure-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/aws/process/shielding_gas_type-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/aws/process/shielding_gas_type-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/dataset-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/dataset-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/data_array-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/data_array-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/dataset-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/dataset-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/dimension-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/dimension-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/file-0.1.0
Expand All @@ -43,16 +41,6 @@ tags:
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/generic_series-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/generic_series_free_dimension-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/generic_series_free_dimension-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/mathematical_expression-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/mathematical_expression-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/time_series-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/time_series-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/time_series-0.1.1
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/time_series-0.1.1
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/variable-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/variable-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/variable-0.1.1
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/variable-0.1.1
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/geometry/spatial_data-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/geometry/spatial_data-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/geometry/spatial_data-0.1.1
Expand All @@ -63,12 +51,22 @@ tags:
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/graph/di_graph-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/graph/di_node-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/graph/di_node-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/mathematical_expression-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/mathematical_expression-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/time_series-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/time_series-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/time_series-0.1.1
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/time_series-0.1.1
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/transformations/coordinate_system_hierarchy-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/transformations/coordinate_system_hierarchy-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/transformations/local_coordinate_system-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/transformations/local_coordinate_system-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/transformations/rotation-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/transformations/rotation-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/variable-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/variable-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/core/variable-0.1.1
schema_uri: asdf://weldx.bam.de/weldx/schemas/core/variable-0.1.1
- tag_uri: asdf://weldx.bam.de/weldx/tags/debug/test_property_tag-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/debug/test_property_tag-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/debug/test_shape_validator-0.1.0
Expand Down Expand Up @@ -113,12 +111,12 @@ tags:
schema_uri: asdf://weldx.bam.de/weldx/schemas/measurement/signal_transformation-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/measurement/source-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/measurement/source-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/process/GMAW-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/process/GMAW-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/process/CLOOS/pulse-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/process/CLOOS/pulse-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/process/CLOOS/spray_arc-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/process/CLOOS/spray_arc-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/process/GMAW-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/process/GMAW-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/time/datetimeindex-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/time/datetimeindex-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/time/time-0.1.0
Expand All @@ -133,4 +131,6 @@ tags:
schema_uri: asdf://weldx.bam.de/weldx/schemas/units/quantity-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/units/units-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/units/units-0.1.0
- tag_uri: asdf://weldx.bam.de/weldx/tags/uuid-0.1.0
schema_uri: asdf://weldx.bam.de/weldx/schemas/uuid-0.1.0
...

0 comments on commit af9df21

Please sign in to comment.