simplify build script #41
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: gh aw compile --validate --instructions --workflows-dir workflows | |
| 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 |