testing library generation #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: generating yaml file | |
on: | |
push: | |
paths: | |
- 'linkml-schema/source_library_generation/**' | |
pull_request: | |
paths: | |
- 'linkml-schema/source_library_generation/**' | |
permissions: | |
contents: write | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install the required python packages | |
run: | | |
python -m pip install .[test] | |
pip install git+https://github.com/brain-bican/bkbit.git | |
pip install git+https://github.com/linkml/schemasheets.git@649af7e1 | |
- name: Other installations | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential git wget curl | |
- name: Generate yaml model | |
run: | | |
cd linkml-schema | |
bkbit schema2model -o library_generation.yaml --gsheet --gsheet-download-dir source_library_generation/gsheet_output source_library_generation/gsheet.yaml --no-inlined | |
cd .. | |
- name: Adding other model representations to git | |
# this might fail when running in PR mode because of the git push | |
# but the files should be added since it's also run on push | |
continue-on-error: true | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
if ! git ls-files --error-unmatch linkml-schema/library_generation.yaml; then | |
git add linkml-schema/library_generation.yaml | |
git add linkml-schema/source_library_generation/gsheet_output | |
git commit -m "adding a new linkml model" | |
elif ! git diff --quiet; then | |
git add linkml-schema/library_generation.yaml | |
git add linkml-schema/source_library_generation/gsheet_output | |
git commit -m "generate new version of the linkml model" | |
echo "Changes detected, after committing" | |
git push | |
else | |
echo "No changes to commit" | |
fi |