Skip to content

Commit 396375e

Browse files
Run CI on self-hosted runners (#6)
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) <noreply@anthropic.com>
1 parent f9af3b3 commit 396375e

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

.github/workflows/build.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@ on:
66
pull_request:
77
branches: [master]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build:
11-
runs-on: ubuntu-24.04
15+
runs-on: self-hosted
16+
container:
17+
image: quantconnect/lean:foundation
18+
options: --cpus 12 --memory 12g
19+
env:
20+
QC_JOB_USER_ID: ${{ secrets.QC_JOB_USER_ID }}
21+
QC_API_ACCESS_TOKEN: ${{ secrets.QC_API_ACCESS_TOKEN }}
22+
QC_JOB_ORGANIZATION_ID: ${{ secrets.QC_JOB_ORGANIZATION_ID }}
23+
QC_COINAPI_API_KEY: ${{ secrets.QC_COINAPI_API_KEY }}
1224
steps:
1325
- name: Checkout
1426
uses: actions/checkout@v2
1527

16-
- name: Liberate disk space
17-
uses: jlumbroso/free-disk-space@main
18-
with:
19-
tool-cache: true
20-
large-packages: false
21-
docker-images: false
22-
swap-storage: false
23-
2428
- name: Checkout Lean Same Branch
2529
id: lean-same-branch
2630
uses: actions/checkout@v2
@@ -40,18 +44,14 @@ jobs:
4044
- name: Move Lean
4145
run: mv Lean ../Lean
4246

43-
- name: Pull Foundation Image
44-
uses: addnab/docker-run-action@v3
45-
with:
46-
image: quantconnect/lean:foundation
47-
options: -v /home/runner/work:/__w --workdir /__w/Lean.DataSource.CoinAPI/Lean.DataSource.CoinAPI -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_COINAPI_API_KEY=${{ secrets.QC_COINAPI_API_KEY }}
48-
shell: bash
49-
run: |
50-
# Build QuantConnect.DataSource.CoinAPI
51-
dotnet build ./QuantConnect.CoinAPI/QuantConnect.DataSource.CoinAPI.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \
52-
# Build DataProcessing
53-
dotnet build ./DataProcessing/DataProcessing.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \
54-
# Build QuantConnect.DataSource.CoinAPI.Tests
55-
dotnet build ./QuantConnect.CoinAPI.Tests/QuantConnect.DataSource.CoinAPI.Tests.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \
56-
# Run QuantConnect.DataSource.CoinAPI.Tests
57-
dotnet test ./QuantConnect.CoinAPI.Tests/bin/Release/QuantConnect.Lean.DataSource.CoinAPI.Tests.dll
47+
- name: Run build and tests
48+
run: |
49+
# Build QuantConnect.DataSource.CoinAPI
50+
dotnet build ./QuantConnect.CoinAPI/QuantConnect.DataSource.CoinAPI.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \
51+
# Build DataProcessing
52+
dotnet build ./DataProcessing/DataProcessing.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \
53+
# Build QuantConnect.DataSource.CoinAPI.Tests
54+
dotnet build ./QuantConnect.CoinAPI.Tests/QuantConnect.DataSource.CoinAPI.Tests.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \
55+
# Run QuantConnect.DataSource.CoinAPI.Tests
56+
dotnet test ./QuantConnect.CoinAPI.Tests/bin/Release/QuantConnect.Lean.DataSource.CoinAPI.Tests.dll
57+

0 commit comments

Comments
 (0)