Build slims #186
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: Build slims | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- 'config/*' | |
push: | |
paths: | |
- 'config.yaml' | |
- '.github/workflows/build.yml' | |
- './config/*' | |
schedule: | |
- cron: 1 0 1 1-12 * | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
# Get slimmer and robot | |
- name: add slimmer and robot URLs to environment | |
run: | | |
echo $(java --version) | |
config_file="config.yaml" | |
robot_jar="" | |
robot="" | |
slimmer="" | |
while IFS=":" read -r key value; do | |
key=$(echo "$key" | tr -d '[:space:]') | |
case "$key" in | |
robot-jar) | |
robot_jar=$(echo "$value" | tr -d '[:space:]') | |
;; | |
robot-wrapper) | |
robot=$(echo "$value" | tr -d '[:space:]') | |
;; | |
slimmer) | |
slimmer=$(echo "$value" | tr -d '[:space:]') | |
;; | |
esac | |
done < "$config_file" | |
echo SLIMMER: $slimmer | |
echo ROBOT JAR: $robot_jar | |
echo ROBOT WRAPPER: $robot | |
echo 'slimmer='${slimmer}'' >> $GITHUB_ENV | |
echo 'robot='${robot}'' >> $GITHUB_ENV | |
echo 'robot_jar='${robot_jar}'' >> $GITHUB_ENV | |
- name: get slimmer | |
run: wget ${{ env.slimmer }} | |
- name: get robot | |
run: | | |
wget ${{ env.robot }} | |
wget ${{ env.robot_jar}} | |
# slim all ontologies | |
# Authorize running slim script | |
- name: authorize running slim scripts | |
run: chmod 755 scripts/src/build-workflow/*.sh | |
# Slim aopo | |
- name: slim-aopo | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh aopo | |
# Slim bao | |
- name: slim-bao | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh bao | |
# Slim bfo | |
- name: slim-bfo | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh bfo | |
# Slim bto | |
- name: slim-bto | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh bto | |
# Slim ccont | |
- name: slim-ccont | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh ccont | |
# Slim cheminf | |
- name: slim-cheminf | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh cheminf | |
# Slim chebi | |
- name: slim-chebi | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh chebi | |
# Slim chmo | |
- name: slim-chmo | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh chmo | |
# Slim clo | |
- name: slim-clo | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh clo | |
# Slim efo | |
- name: slim-efo | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh efo | |
# Slim envo | |
- name: slim-envo | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh envo | |
# Slim fabio | |
- name: slim-fabio | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh fabio | |
# Slim go | |
- name: slim-go | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh go | |
# Slim iao | |
- name: slim-iao | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh iao | |
# Slim ncit | |
- name: slim-ncit | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh ncit | |
# Slim npo | |
- name: slim-npo | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh npo | |
# Slim oae | |
- name: slim-oae | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh oae | |
# Slim obcs | |
- name: slim-obcs | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh obcs | |
# Slim obi | |
- name: slim-obi | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh obi | |
# Slim pato | |
- name: slim-pato | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh pato | |
# Slim sio | |
- name: slim-sio | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh sio | |
# Slim uberon | |
- name: slim-uberon | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh uberon | |
# Slim uo | |
- name: slim-uo | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh uo | |
# Slim msio | |
- name: slim-msio | |
if: always() | |
run: bash scripts/src/build-workflow/slim.sh msio | |
# apply props bao | |
- name: Apply props bao | |
if: always() | |
run: bash scripts/src/build-workflow/props.sh bao | |
# apply props npo | |
- name: Apply props npo | |
if: always() | |
run: bash scripts/src/build-workflow/props.sh npo | |
# apply props sio | |
- name: Apply props sio | |
if: always() | |
run: bash scripts/src/build-workflow/props.sh sio | |
- name: Apply props cheminf | |
if: always() | |
run: bash scripts/src/build-workflow/props.sh cheminf | |
- name: Apply props ro | |
if: always() | |
run: bash scripts/src/build-workflow/props.sh ro | |
# Commit and push | |
- name: Commit OWL files | |
run: | | |
if [[ "${{ github.ref_name }}" == *"merge"* ]]; then | |
exit 0 | |
fi | |
git checkout "${{ github.ref_name }}" | |
git pull | |
git add -f external-dev/*.owl | |
git config --local user.email "[email protected]" | |
git config --local user.name "Slimmer bot" | |
# Check if there are changes to commit | |
if git diff-index --quiet HEAD --; then | |
echo "No changes to commit." | |
else | |
git commit -m "Actions - slim updated" ./external-dev/*.owl || true | |
fi | |
# Check if there are changes to push | |
if [[ $(git rev-parse --abbrev-ref HEAD) == "${{ github.ref_name }}" ]]; then | |
if [ -n "$(git cherry -v)" ]; then | |
git push || echo "Push failed." | |
else | |
echo "No changes to push." | |
fi | |
fi | |