Files
Martin-Molinero c57fd18b64
Syntax Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Run CI on self-hosted runners (#9540)
* Run CI on self-hosted runners

Switch all GitHub Actions workflows from the GitHub-hosted ubuntu-24.04
runners to self-hosted runners. The Benchmarks workflow targets a runner
with the dedicated 'benchmark' label so benchmarking only runs on that
machine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Guard disk cleanup to GitHub-hosted runners, mount benchmark data read-only

Skip the 'Liberate disk space' step on self-hosted runners (only run it on
github-hosted ones) and mount the benchmark /nas:/Data volume read-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Run workflows directly inside foundation container

Self-hosted runners are not allowed to run docker, so the docker
run/exec (runInContainer) pattern fails. Run every workflow directly
inside a job-level container: quantconnect/lean:foundation, matching the
benchmarks workflow. Drops the Liberate disk space, docker helper and
Start container steps; secrets are passed via the container env.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Cancel in-progress runs on new branch commits

Add a concurrency group keyed to workflow + ref with cancel-in-progress so
pushing a new commit to a branch cancels the still-running workflow for the
previous commit. Applied to all CI/test workflows; rebase-org-branches is
left untouched to avoid cancelling a rebase mid-push.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fix dotnet tools PATH in research workflow

Inside a job-level container GitHub sets HOME=/github/home, so the global
tool installs to $HOME/.dotnet/tools, not /root/.dotnet/tools. Use $HOME so
dotnet-interactive is found and 'dotnet interactive jupyter install' works.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Make stub-generation check POSIX-sh compatible

The container steps run under sh, where bash-only [[ ]] is unavailable.
Rewrite the tag/stub-generation gate as a POSIX case + [ ] test so it
behaves correctly on tag builds instead of silently being skipped.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Cap CI containers to 12 CPUs and 12g RAM

Add docker options (--cpus 12 --memory 12g) to every workflow container so
jobs running on high-core self-hosted hosts can't monopolize resources.
Limits are per container, so concurrent jobs each get their own allotment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 16:11:32 -03:00

37 lines
1.3 KiB
YAML

name: API Tests
on:
push:
branches: ['*']
tags: ['*']
pull_request:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: self-hosted
container:
image: quantconnect/lean:foundation
options: --cpus 12 --memory 12g
env:
QC_JOB_USER_ID: ${{ secrets.QC_JOB_USER_ID }}
QC_API_ACCESS_TOKEN: ${{ secrets.QC_API_ACCESS_TOKEN }}
QC_JOB_ORGANIZATION_ID: ${{ secrets.QC_JOB_ORGANIZATION_ID }}
# Only run on push events (not on pull_request) for security reasons in order to be able to use secrets
if: ${{ github.event_name == 'push' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run API Tests
run: |
# Build
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
# Run Projects tests
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --blame-hang-timeout 7minutes --blame-crash --logger "console;verbosity=detailed" --filter "FullyQualifiedName=QuantConnect.Tests.API.ProjectTests|FullyQualifiedName=QuantConnect.Tests.API.ObjectStoreTests" -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\)