Skip to content

Commit 9bc2adc

Browse files
Run CI on self-hosted runners (#42)
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 26b5f94 commit 9bc2adc

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

.github/workflows/gh-actions.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,25 @@ on:
44
push:
55
branches: ['*']
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
711
jobs:
812
build:
9-
runs-on: ubuntu-24.04
13+
runs-on: self-hosted
14+
container:
15+
image: quantconnect/lean:foundation
16+
options: --cpus 12 --memory 12g
17+
env:
18+
QC_POLYGON_API_KEY: ${{ secrets.POLYGON_API_KEY }}
19+
QC_JOB_USER_ID: ${{ secrets.JOB_USER_ID }}
20+
QC_API_ACCESS_TOKEN: ${{ secrets.API_ACCESS_TOKEN }}
21+
QC_JOB_ORGANIZATION_ID: ${{ secrets.JOB_ORGANIZATION_ID }}
1022
steps:
1123
- name: Checkout
1224
uses: actions/checkout@v2
1325

14-
- name: Liberate disk space
15-
uses: jlumbroso/free-disk-space@main
16-
with:
17-
tool-cache: true
18-
large-packages: false
19-
docker-images: false
20-
swap-storage: false
21-
2226
- name: Checkout Lean Same Branch
2327
id: lean-same-branch
2428
uses: actions/checkout@v2
@@ -38,14 +42,10 @@ jobs:
3842
- name: Move Lean
3943
run: mv Lean ../Lean
4044

41-
- name: Run Image
42-
uses: addnab/docker-run-action@v3
43-
with:
44-
image: quantconnect/lean:foundation
45-
options: -v /home/runner/work:/__w --workdir /__w/Lean.DataSource.Polygon/Lean.DataSource.Polygon -e QC_POLYGON_API_KEY=${{ secrets.POLYGON_API_KEY }} -e QC_JOB_USER_ID=${{ secrets.JOB_USER_ID }} -e QC_API_ACCESS_TOKEN=${{ secrets.API_ACCESS_TOKEN }} -e QC_JOB_ORGANIZATION_ID=${{ secrets.JOB_ORGANIZATION_ID }}
46-
shell: bash
47-
run: |
48-
# Build
49-
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Polygon.sln && \
50-
# Run Tests
51-
dotnet test ./QuantConnect.Polygon.Tests/bin/Release/QuantConnect.Lean.DataSource.Polygon.Tests.dll
45+
- name: Run build and tests
46+
run: |
47+
# Build
48+
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Polygon.sln && \
49+
# Run Tests
50+
dotnet test ./QuantConnect.Polygon.Tests/bin/Release/QuantConnect.Lean.DataSource.Polygon.Tests.dll
51+

0 commit comments

Comments
 (0)