CI action to check for changed schema

This commit is contained in:
sneakers-the-rat 2024-08-20 19:57:35 -07:00
parent bb3512723f
commit b9574a424b
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
2 changed files with 42 additions and 2 deletions

40
.github/workflows/model_rebuild.yml vendored Normal file
View file

@ -0,0 +1,40 @@
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"
- name: Install packages
run: |
python -m pip install ./nwb_schema_language
python -m pip install ./nwb_linkml
- name: Build models
run: |
python -m ./scripts/generate_core.py
python -m ./scripts/generate_core.py --hdmf
- 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)"
exit 1
fi

View file

@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install system libraries
run: |
@ -26,7 +26,7 @@ jobs:
sudo apt install -y libhdf5-dev hdf5-tools
- name: Set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'