nwb-linkml/.github/workflows/model_rebuild.yml

47 lines
1.1 KiB
YAML
Raw Normal View History

2024-08-21 02:57:35 +00:00
name: Model Rebuild
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_models:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
2024-08-21 03:00:07 +00:00
cache: pip
cache-dependency-path: |
nwb_linkml/pyproject.toml
nwb_schema_language/pyproject.toml
2024-08-21 02:57:35 +00:00
- name: Install packages
run: |
2024-08-21 03:07:41 +00:00
python -m pip install -e ./nwb_schema_language
python -m pip install -e ./nwb_linkml
python -m pip install -e ./nwb_models
2024-08-21 02:57:35 +00:00
- name: Build models
run: |
2024-08-21 03:00:38 +00:00
python ./scripts/generate_core.py
python ./scripts/generate_core.py --hdmf
2024-08-21 02:57:35 +00:00
- name: Test for uncommitted changes
run: |
if [ -z "$(git status --porcelain)" ];
then
echo "No changes detected"
exit 0
else
echo "Changes to models detected"
echo "$(git status)"
2024-08-21 03:05:48 +00:00
echo "$(git diff)"
2024-08-21 02:57:35 +00:00
exit 1
fi