From a2a1012744684315f4b0a1458dcfddaa9606b5fa Mon Sep 17 00:00:00 2001 From: Martin-Molinero Date: Wed, 17 Jun 2026 20:43:16 +0000 Subject: [PATCH] Run CI on self-hosted runners Mirror QuantConnect/Lean#9540 (commit c57fd18b): run the build/test workflow on self-hosted runners directly inside a job-level quantconnect/lean:foundation container (--cpus 12 --memory 12g) instead of the GitHub-hosted ubuntu runner + addnab/docker-run wrapper. Drops the disk-cleanup step and the docker-run wrapper (build/test now run as a normal step inside the container; secrets via container env), and adds a concurrency group (cancel-in-progress). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/build.yml | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af82c1b..ee3ab61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,21 +6,25 @@ on: pull_request: branches: [master] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: - runs-on: ubuntu-24.04 + 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 }} + QC_ALPHA_VANTAGE_API_KEY: ${{ secrets.QC_ALPHA_VANTAGE_API_KEY }} steps: - name: Checkout uses: actions/checkout@v2 - - name: Liberate disk space - uses: jlumbroso/free-disk-space@main - with: - tool-cache: true - large-packages: false - docker-images: false - swap-storage: false - - name: Checkout Lean Same Branch id: lean-same-branch uses: actions/checkout@v2 @@ -40,16 +44,12 @@ jobs: - name: Move Lean run: mv Lean ../Lean - - name: Pull Foundation Image - uses: addnab/docker-run-action@v3 - with: - image: quantconnect/lean:foundation - options: -v /home/runner/work:/__w --workdir /__w/Lean.DataSource.AlphaVantage/Lean.DataSource.AlphaVantage -e QC_JOB_USER_ID=${{ secrets.QC_JOB_USER_ID }} -e QC_API_ACCESS_TOKEN=${{ secrets.QC_API_ACCESS_TOKEN }} -e QC_JOB_ORGANIZATION_ID=${{ secrets.QC_JOB_ORGANIZATION_ID }} -e QC_ALPHA_VANTAGE_API_KEY=${{ secrets.QC_ALPHA_VANTAGE_API_KEY }} - shell: bash - run: | - # Build QuantConnect.DataSource.AlphaVantage - dotnet build ./QuantConnect.AlphaVantage/QuantConnect.DataSource.AlphaVantage.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \ - # Build QuantConnect.DataSource.AlphaVantage.Tests - dotnet build ./QuantConnect.AlphaVantage.Tests/QuantConnect.DataSource.AlphaVantage.Tests.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \ - # Run QuantConnect.DataSource.AlphaVantage.Tests - dotnet test ./QuantConnect.AlphaVantage.Tests/bin/Release/QuantConnect.Lean.DataSource.AlphaVantage.Tests.dll \ No newline at end of file + - name: Run build and tests + run: | + # Build QuantConnect.DataSource.AlphaVantage + dotnet build ./QuantConnect.AlphaVantage/QuantConnect.DataSource.AlphaVantage.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \ + # Build QuantConnect.DataSource.AlphaVantage.Tests + dotnet build ./QuantConnect.AlphaVantage.Tests/QuantConnect.DataSource.AlphaVantage.Tests.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \ + # Run QuantConnect.DataSource.AlphaVantage.Tests + dotnet test ./QuantConnect.AlphaVantage.Tests/bin/Release/QuantConnect.Lean.DataSource.AlphaVantage.Tests.dll +