Skip to content

Scrum 4190

Scrum 4190 #292

name: Regenerate Alliance Schema Model Artifacts
on:
pull_request:
types: [synchronize, opened, reopened]
branches:
- main
jobs:
generate-artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python Environment
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
- name: Setup build environment
run: |
sudo apt update
sudo apt install -y graphviz
wget https://github.com/joelittlejohn/jsonschema2pojo/releases/download/jsonschema2pojo-1.0.2/jsonschema2pojo-1.0.2.tar.gz
tar -xvzf jsonschema2pojo-1.0.2.tar.gz
#----------------------------------------------
# install & configure poetry
#----------------------------------------------
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install poetry dependencies
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
- name: Generate AGR Curation Model artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
export PATH=$PATH:`pwd`/jsonschema2pojo-1.0.2/bin
make clean-artifacts
make -B gen-artifacts
- name: Commit and push artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
if [[ $(git add -n generated/) ]]; then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add generated/
git commit -m "Automated artifacts regeneration [skip actions]"
git push
else
echo "No artifact changes to commit."
fi