Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
update doc structure and workflows
  • Loading branch information
jsimonclark committed Jun 23, 2024
1 parent bf6496d commit 021407a
Show file tree
Hide file tree
Showing 64 changed files with 4,108 additions and 18 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ jobs:
git fetch --tags
git tag | while read TAG; do
sudo mkdir -p "docs/_build/html/versions/$TAG"
sudo cp "battery.ttl" "docs/_build/html/versions/$TAG/"
python docs/scripts/apply_foops_recommendations.py battery.ttl battery-foops.ttl
python docs/scripts/apply_foops_recommendations.py batteryquantities.ttl batteryquantities-foops.ttl
sudo cp "battery-foops.ttl" "docs/_build/html/versions/$TAG/"
sudo cp "batteryquantities-foops.ttl" "docs/_build/html/versions/$TAG/"
sudo cp "battery-inferred.ttl" "docs/_build/html/versions/$TAG/"
sudo cp "batteryquantities.ttl" "docs/_build/html/versions/$TAG/"
if [ -d "context" ]; then
echo "Context directory exists, copying context.json to $TAG"
Expand All @@ -96,8 +98,10 @@ jobs:
- name: Copy TTL files to HTML directory
run: |
sudo cp "battery.ttl" "docs/_build/html/battery.ttl"
sudo cp "batteryquantities.ttl" "docs/_build/html/batteryquantities.ttl"
python docs/scripts/apply_foops_recommendations.py battery.ttl battery-foops.ttl
python docs/scripts/apply_foops_recommendations.py batteryquantities.ttl batteryquantities-foops.ttl
sudo cp "battery-foops.ttl" "docs/_build/html/battery.ttl"
sudo cp "batteryquantities-foops.ttl" "docs/_build/html/batteryquantities.ttl"
sudo cp "battery-inferred.ttl" "docs/_build/html/battery-inferred.ttl"
- name: Upload artifacts
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/reason.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: reasoner

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
reasoning:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install rdflib owlrl
- name: Run reasoning script
run: |
cd docs/scripts
python check_reasoner.py
57 changes: 57 additions & 0 deletions .github/workflows/update_foops_badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Update FOOPS Score Badge

on:
workflow_run:
workflows: ["docs"]
types:
- completed

env:
GIT_USER_NAME: BattINFO Developers
GIT_USER_EMAIL: "[email protected]"

jobs:
update-badge:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: pip install requests

- name: Fetch FOOPS score and update badge
run: |
python docs/scripts/generate_foops_badge.py
- name: Configure Git
run: |
git config --local user.email "${{ env.GIT_USER_EMAIL }}"
git config --local user.name "${{ env.GIT_USER_NAME }}"
- name: Commit any changes before pulling
run: |
git add -A
git diff --staged --quiet || git commit -m "Stash changes before pull"
- name: Pull latest changes
run: git pull origin master --rebase

- name: Commit changes
run: |
git add README.md
git diff --staged --quiet || git commit -m "Update FOOPS score badge"
- name: Push changes
run: git push origin HEAD:master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 021407a

Please sign in to comment.