Continuous Integration¶
This page describes the continuous integration (CI) setup for PBPKO, including automated testing, validation, and deployment processes.
Overview¶
PBPKO uses GitHub Actions for continuous integration to ensure: - Automated testing on every commit - Ontology validation - Documentation deployment - Release automation
CI Workflows¶
1. Build and Test Workflow¶
File: .github/workflows/build.yml
Triggers: - Push to main branch - Pull requests - Manual trigger
Steps: 1. Checkout code 2. Setup Java (for ROBOT) 3. Download ROBOT 4. Run ontology build 5. Validate ontology 6. Run tests 7. Generate reports
Example:
name: Build and Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: '11'
- name: Download ROBOT
run: wget https://github.com/ontodev/robot/releases/download/v1.8.1/robot.jar
- name: Build ontology
run: ./scripts/build.sh
- name: Validate ontology
run: robot validate --input Robot/ontologies/pbpko.owl
2. Documentation Deployment¶
File: .github/workflows/docs.yml
Triggers: - Push to main branch - Manual trigger
Steps: 1. Checkout code 2. Setup Python 3. Install MkDocs 4. Build documentation 5. Deploy to GitHub Pages
Example:
name: Deploy Documentation
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: pip install mkdocs mkdocs-material
- name: Deploy
run: mkdocs gh-deploy --force
3. Release Workflow¶
File: .github/workflows/release.yml
Triggers: - Tag creation - Manual trigger
Steps: 1. Checkout code 2. Setup Java 3. Download ROBOT 4. Build ontology 5. Generate release files 6. Create GitHub release
Example:
name: Release
on:
push:
tags: ['v*']
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: '11'
- name: Download ROBOT
run: wget https://github.com/ontodev/robot/releases/download/v1.8.1/robot.jar
- name: Build ontology
run: ./scripts/build.sh
- name: Create release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
Automated Testing¶
Ontology Validation¶
ROBOT Validation:
Checks performed: - OWL syntax validation - Logical consistency - Property restrictions - Class hierarchy validation
Template Validation¶
Template Checking:
Checks performed: - TSV format validation - Required column validation - ID uniqueness - Reference validation
Build Testing¶
Complete Build Test:
Tests performed: - Template processing - Import merging - Ontology generation - Output validation
Quality Assurance¶
Code Quality¶
Automated Checks: - Syntax validation - Format checking - Linting - Security scanning
Documentation Quality¶
Documentation Checks: - Link validation - Markdown syntax - Image optimization - Accessibility testing
Performance Testing¶
Performance Checks: - Build time monitoring - Memory usage tracking - Output size validation - Processing speed testing
Deployment Automation¶
GitHub Pages Deployment¶
Automatic deployment: - Triggers on main branch push - Builds MkDocs site - Deploys to GitHub Pages - Updates live documentation
Release Automation¶
Release process: - Tag-based triggering - Automated build - Release file generation - GitHub release creation
Monitoring and Alerts¶
Build Status¶
Status Monitoring: - GitHub Actions status badges - Build success/failure notifications - Performance metrics tracking - Error reporting
Notification System¶
Alerts: - Email notifications for failures - Slack integration for team updates - GitHub issue creation for errors - Status page updates
Configuration Management¶
Environment Variables¶
Secrets Management: - GitHub secrets for sensitive data - Environment-specific configurations - API key management - Access token handling
Build Configuration¶
Configuration Files:
- mkdocs.yml - Documentation configuration
- robot-config.yaml - ROBOT configuration
- .github/workflows/ - CI workflow definitions
- scripts/ - Build script configurations
Troubleshooting¶
Common Issues¶
Build Failures: - Check ROBOT version compatibility - Verify template format - Validate import URLs - Check Java version
Deployment Issues: - Verify GitHub Pages settings - Check repository permissions - Validate MkDocs configuration - Review deployment logs
Debug Mode¶
Enable Debug Output:
- name: Debug build
run: |
echo "Debug information"
ls -la Robot/ontologies/
robot --verbose validate --input Robot/ontologies/pbpko.owl
Best Practices¶
Workflow Design¶
Design Principles: - Keep workflows simple and focused - Use reusable workflow components - Implement proper error handling - Include comprehensive logging
Security¶
Security Measures: - Use GitHub secrets for sensitive data - Implement proper access controls - Regular security updates - Vulnerability scanning
Performance¶
Performance Optimization: - Use caching for dependencies - Parallel job execution - Optimize build scripts - Monitor resource usage
Maintenance¶
Regular Updates¶
Update Schedule: - Monthly dependency updates - Quarterly workflow reviews - Annual security audits - Continuous monitoring
Monitoring¶
Monitoring Tasks: - Build success rates - Performance metrics - Error frequency - Resource usage