Merge pull request #2522 from Ruuudy1/feature-alternative-equity-cci-… #421
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: Syntax Tests | |
| on: | |
| push: | |
| paths: | |
| - 'project-templates/**' | |
| - '.github/workflows/syntax-tests.yml' | |
| pull_request: | |
| branches: [master] | |
| paths: | |
| - 'project-templates/**' | |
| - '.github/workflows/syntax-tests.yml' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Liberate disk space | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: true | |
| large-packages: false | |
| docker-images: false | |
| swap-storage: false | |
| - name: Define docker helper | |
| run: | | |
| echo 'runInContainer() { docker exec test-container "$@"; }' > $HOME/ci_functions.sh | |
| echo "BASH_ENV=$HOME/ci_functions.sh" >> $GITHUB_ENV | |
| - name: Start container | |
| run: | | |
| docker run -d \ | |
| --workdir /__w/Documentation/Documentation \ | |
| -v /home/runner/work:/__w \ | |
| -e DOCS_TEMPLATE_USER_ID=${{ secrets.QUANTCONNECT_USER_ID }} \ | |
| -e DOCS_TEMPLATE_USER_TOKEN="${{ secrets.QUANTCONNECT_API_TOKEN }}" \ | |
| -e DOCS_TEMPLATE_ORG_ID=${{ secrets.QUANTCONNECT_ORG_ID }} \ | |
| --name test-container \ | |
| quantconnect/lean:foundation \ | |
| tail -f /dev/null | |
| - name: Run Syntax Test | |
| run: | | |
| runInContainer bash -c "pip install --no-cache-dir quantconnect-stubs requests types-requests==2.32.* types-pytz==2025.2.0.* mypy==1.20.2" | |
| runInContainer python -u project-templates/python/run_syntax_check.py | |
| - name: Run Project Match Check | |
| # Repository secrets (QuantConnect credentials) are not exposed to | |
| # pull_request runs from forks, so skip this step for fork PRs to avoid | |
| # failing on missing credentials. It still runs on push and on PRs from | |
| # branches in this repo. The syntax check above runs for every trigger. | |
| if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} | |
| run: | | |
| runInContainer python -u project-templates/run_project_match_check.py | |
| - name: Open PR for templates.json changes | |
| if: always() && github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| branch: auto/update-template-project-ids | |
| title: Update templates.json with new project IDs | |
| commit-message: Update templates.json with new project IDs | |
| body: | | |
| Project IDs created automatically by the `Run Project Match Check` | |
| step in the `Syntax Tests` workflow. Merge to keep cloud project | |
| IDs in sync with the templates in this repo. | |
| add-paths: | | |
| project-templates/templates.json | |
| delete-branch: true |