Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The work
114 changes: 0 additions & 114 deletions .github/workflows/ci-common.yaml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/ci-dev.yaml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/ci-release.yaml

This file was deleted.

162 changes: 162 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: FUEL_CI_Dev

concurrency:
group: fuel-gist-badges
cancel-in-progress: true

on:
push:
branches:
- dev
- main

env:
ONTO_DIR: src
ONTO_FILE: fuel.ttl
ONTO_ABBREV: fuel
DOCS_DIR: docs
RELEASES_DIR: ./public/releases

jobs:
check-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.check.outputs.version }}
is_new: ${{ steps.check.outputs.is_new }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check version
id: check
run: |
VERSION=$(grep -oP 'owl:versionInfo\s+"\K[^"]+' src/fuel.ttl || echo "")
echo "version=$VERSION" >> $GITHUB_OUTPUT
if [ "${{ github.ref_name }}" != "main" ] || [ -z "$VERSION" ]; then
echo "is_new=false" >> $GITHUB_OUTPUT
exit 0
fi
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "is_new=false" >> $GITHUB_OUTPUT
else
echo "is_new=true" >> $GITHUB_OUTPUT
fi

build:
needs: check-version
runs-on: ubuntu-latest
env:
DEV_DIR: ${{ github.ref_name == 'main' && './public' || './public/dev' }}
RELEASE_VERSION: ${{ needs.check-version.outputs.is_new == 'true' && needs.check-version.outputs.version || '' }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Compute safe ref name
if: always()
run: |
SAFE_REF="${GITHUB_REF_NAME//\//-}"
echo "SAFE_REF=$SAFE_REF" >> $GITHUB_ENV

- name: Java Setup
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

- name: Install ROBOT
run: |
wget -q https://github.com/ontodev/robot/releases/download/v1.9.8/robot.jar -O robot.jar
curl -sL https://raw.githubusercontent.com/ontodev/robot/master/bin/robot > robot
chmod +x robot

- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install rdflib dotenv pylode

- name: Validate ontology profile
id: profile
run: |
./robot validate-profile --input "${ONTO_DIR}/${ONTO_FILE}" --profile DL -vvv || \
(echo "Profile check failed." && exit 1)

- name: Badge — Syntax
if: always()
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: ${{ secrets.GIST_ID }}
filename: fuel-ci-profile-${{ env.SAFE_REF }}.json
label: OWL DL Profile (${{ github.ref_name }})
message: ${{ steps.profile.outcome || 'failed' }}
color: ${{ steps.profile.outcome == 'success' && 'brightgreen' || steps.profile.outcome == 'cancelled' && 'yellow' || 'red' }}
forceUpdate: true

- name: Reasoning and consistency check
id: reasoning
run: |
if ./robot reason --reasoner HermiT --input "${ONTO_DIR}/${ONTO_FILE}" --output reasoned.owl; then
echo "result=consistent" >> $GITHUB_OUTPUT
else
echo "result=inconsistent" >> $GITHUB_OUTPUT
exit 1
fi

- name: Badge — Reasoning
if: always()
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: ${{ secrets.GIST_ID }}
filename: fuel-ci-reasoning-${{ github.ref_name }}.json
label: Reasoning (${{ github.ref_name }})
message: ${{ steps.reasoning.outputs.result || 'failed'}}
color: ${{ steps.reasoning.outputs.result == 'consistent' && 'brightgreen' || 'red' }}
forceUpdate: true

- name: Generate ontology syntaxes and documentation
run: |
python3 src/scripts/onto_syntax_doc.py

- name: Upload dev artifact
# if DEV_DIR is set to something non-empty, we upload the whole public struct
if: ${{ env.DEV_DIR != '' && env.DEV_DIR != null }}
uses: actions/upload-artifact@v4
with:
name: site
path: ./public

deploy:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Download site artifact
uses: actions/download-artifact@v4
with:
name: site
path: ./public

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
keep_files: true

create-release:
needs: [check-version, deploy]
if: needs.check-version.outputs.is_new == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.check-version.outputs.version }}
name: Release v${{ needs.check-version.outputs.version }}
generate_release_notes: true
2 changes: 1 addition & 1 deletion src/scripts/onto_syntax_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def generate_widoco_docs(outdir, onto_dir, onto_file, version="1.4.25"):
f.write(f'<li><a href="{r}/">{r}</a></li>\n')
f.write("</ul>\n</body></html>\n")

elif DEV_DIR:
if DEV_DIR:
# --- development build ---
generate_syntaxes(DEV_DIR)

Expand Down