Skip to content

Commit bef9026

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 df6952f commit bef9026

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

.github/workflows/gh-actions.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,22 @@ 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_BYBIT_API_KEY: ${{ secrets.QC_BYBIT_API_KEY }}
19+
QC_BYBIT_API_SECRET: ${{ secrets.QC_BYBIT_API_SECRET }}
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 }}
1023
env:
1124
QC_BYBIT_API_KEY: ${{ secrets.QC_BYBIT_API_KEY }}
1225
QC_BYBIT_API_SECRET: ${{ secrets.QC_BYBIT_API_SECRET }}
@@ -17,14 +30,6 @@ jobs:
1730
- name: Checkout
1831
uses: actions/checkout@v2
1932

20-
- name: Liberate disk space
21-
uses: jlumbroso/free-disk-space@main
22-
with:
23-
tool-cache: true
24-
large-packages: false
25-
docker-images: false
26-
swap-storage: false
27-
2833
- name: Checkout Lean Same Branch
2934
id: lean-same-branch
3035
uses: actions/checkout@v2
@@ -44,13 +49,10 @@ jobs:
4449
- name: Move Lean
4550
run: mv Lean ../Lean
4651

47-
- uses: addnab/docker-run-action@v3
48-
with:
49-
image: quantconnect/lean:foundation
50-
options: --workdir /__w/Lean.Brokerages.ByBit/Lean.Brokerages.ByBit -v /home/runner/work:/__w -e QC_BYBIT_API_KEY=${{ secrets.QC_BYBIT_API_KEY }} -e QC_BYBIT_API_SECRET=${{ secrets.QC_BYBIT_API_SECRET }} -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 }}
51-
shell: bash
52-
run: |
53-
# Build
54-
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.BybitBrokerage.sln && \
55-
# Run Tests
56-
dotnet test ./QuantConnect.BybitBrokerage.Tests/bin/Release/QuantConnect.Brokerages.Bybit.Tests.dll
52+
- name: Run build and tests
53+
run: |
54+
# Build
55+
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.BybitBrokerage.sln && \
56+
# Run Tests
57+
dotnet test ./QuantConnect.BybitBrokerage.Tests/bin/Release/QuantConnect.Brokerages.Bybit.Tests.dll
58+

0 commit comments

Comments
 (0)