agentics #55
This file contains hidden or 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: Compile Workflows | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'workflows/**' | |
| - '.github/workflows/compile-workflows.yml' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'workflows/**' | |
| - '.github/workflows/compile-workflows.yml' | |
| workflow_dispatch: | |
| jobs: | |
| compile-workflows: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install gh CLI | |
| run: | | |
| type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) | |
| curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ | |
| && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ | |
| && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ | |
| && sudo apt update \ | |
| && sudo apt install gh -y | |
| - name: Install gh aw extension | |
| run: | | |
| gh extension install githubnext/gh-aw || gh extension upgrade githubnext/gh-aw | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Clean up existing lock files | |
| run: | | |
| echo "Cleaning up existing .lock.yml files..." | |
| find workflows -name "*.lock.yml" -type f -delete || true | |
| echo "Cleanup complete" | |
| - name: Compile workflows | |
| run: | | |
| set -e | |
| echo "Compiling workflows..." | |
| # Find all workflow markdown files, excluding shared components | |
| workflow_files=$(find workflows -name "*.md" -type f | grep -v "workflows/agentics/shared/") | |
| if [ -z "$workflow_files" ]; then | |
| echo "No workflow files found" | |
| exit 1 | |
| fi | |
| echo "Found workflow files:" | |
| echo "$workflow_files" | |
| echo "" | |
| failed_compilations=() | |
| compiled_count=0 | |
| # Compile each workflow | |
| for workflow_file in $workflow_files; do | |
| echo "Compiling $workflow_file..." | |
| if gh aw compile --validate "$workflow_file"; then | |
| echo "✅ Successfully compiled $workflow_file" | |
| compiled_count=$((compiled_count + 1)) | |
| else | |
| echo "❌ Failed to compile $workflow_file" | |
| failed_compilations+=("$workflow_file") | |
| fi | |
| echo "" | |
| done | |
| echo "Compilation Summary:" | |
| echo "Successfully compiled: $compiled_count workflows" | |
| if [ ${#failed_compilations[@]} -gt 0 ]; then | |
| echo "Failed compilations: ${#failed_compilations[@]}" | |
| echo "Failed workflows:" | |
| for failed_workflow in "${failed_compilations[@]}"; do | |
| echo " - $failed_workflow" | |
| done | |
| exit 1 | |
| else | |
| echo "All workflows compiled successfully! 🎉" | |
| fi | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Check for generated YAML files | |
| run: | | |
| echo "Checking for generated YAML files..." | |
| # Look for generated .lock.yml files in workflows directory | |
| lock_yml_files=$(find workflows -name "*.lock.yml" -type f | grep -v "workflows/agentics/shared/" || true) | |
| if [ -n "$lock_yml_files" ]; then | |
| echo "Generated .lock.yml files:" | |
| echo "$lock_yml_files" | |
| echo "" | |
| echo "Compilation generated $(echo "$lock_yml_files" | wc -l) workflow files:" | |
| for lock_yml_file in $lock_yml_files; do | |
| echo " ✅ $lock_yml_file" | |
| done | |
| else | |
| echo "⚠️ No generated .lock.yml files found in workflows/" | |
| fi |