Run All Code Generators #495
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: Run All Code Generators | |
| on: | |
| schedule: | |
| - cron: "0 10 * * 5" # Runs "at 10 UTC every Friday" (see https://crontab.guru) | |
| workflow_dispatch: # Run on manual trigger | |
| jobs: | |
| run_all: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install beautifulsoup4==4.14.3 pandas==2.3.3 requests==2.32.3 | |
| - name: Configure git | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "github-actions@github.com" | |
| - name: Run all code generators | |
| env: | |
| QUANTCONNECT_USER_ID: ${{ secrets.QUANTCONNECT_USER_ID }} | |
| QUANTCONNECT_API_TOKEN: ${{ secrets.QUANTCONNECT_API_TOKEN }} | |
| run: | | |
| failed="" | |
| for script in \ | |
| Alternative-Datasets-Code-Generator \ | |
| Alternative-Datasets-Skill-Generator \ | |
| eodhd-macro-indicators-code-generator \ | |
| fred-categories-table-code-generator \ | |
| fundamentals-table-code-generator \ | |
| future-table-code-generator \ | |
| glossary-generator \ | |
| Lean-CLI-API-Reference-Code-Generator \ | |
| market-hour-code-generator \ | |
| Supported-Assets-Table-Code-Generator \ | |
| us-energy-indicators-code-generator \ | |
| indicator_reference_code_generator; do | |
| echo "::group::Running $script" | |
| if ! python "code-generators/$script.py"; then | |
| echo "::error::$script failed" | |
| failed="$failed $script" | |
| fi | |
| if [[ -n $(git status --porcelain) ]]; then | |
| git add -A | |
| git commit -m "Code generated by $script.py" | |
| fi | |
| echo "::endgroup::" | |
| done | |
| if [[ -n "$failed" ]]; then | |
| echo "::error::Failed scripts:$failed" | |
| echo "has_failures=true" >> "$GITHUB_ENV" | |
| fi | |
| - name: Create Pull Request | |
| if: always() | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| branch: github-action-code-generators | |
| title: "Update auto-generated code" | |
| body: "Automated changes from code generators." | |
| committer: "GitHub Actions <github-actions@github.com>" | |
| author: "GitHub Actions <github-actions@github.com>" | |
| - name: Fail if any scripts errored | |
| if: env.has_failures == 'true' | |
| run: exit 1 |