Skip to content

Commit 8d43a5c

Browse files
Run CI on self-hosted runners (#32)
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 6a82d70 commit 8d43a5c

1 file changed

Lines changed: 22 additions & 19 deletions

File tree

.github/workflows/gh-actions.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,27 @@ 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_OANDA_ENVIRONMENT: ${{ secrets.QC_OANDA_ENVIRONMENT }}
19+
QC_OANDA_ACCESS_TOKEN: ${{ secrets.QC_OANDA_ACCESS_TOKEN }}
20+
QC_OANDA_ACCOUNT_ID: ${{ secrets.QC_OANDA_ACCOUNT_ID }}
21+
QC_JOB_USER_ID: ${{ secrets.JOB_USER_ID }}
22+
QC_API_ACCESS_TOKEN: ${{ secrets.API_ACCESS_TOKEN }}
23+
QC_JOB_ORGANIZATION_ID: ${{ secrets.JOB_ORGANIZATION_ID }}
1024
steps:
1125
- name: Checkout
1226
uses: actions/checkout@v2
1327

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-
2228
- name: Checkout Lean Same Branch
2329
id: lean-same-branch
2430
uses: actions/checkout@v2
@@ -38,13 +44,10 @@ jobs:
3844
- name: Move Lean
3945
run: mv Lean ../Lean
4046

41-
- uses: addnab/docker-run-action@v3
42-
with:
43-
image: quantconnect/lean:foundation
44-
options: --workdir /__w/Lean.Brokerages.OANDA/Lean.Brokerages.OANDA -v /home/runner/work:/__w -e QC_OANDA_ENVIRONMENT=${{ secrets.QC_OANDA_ENVIRONMENT }} -e QC_OANDA_ACCESS_TOKEN=${{ secrets.QC_OANDA_ACCESS_TOKEN }} -e QC_OANDA_ACCOUNT_ID=${{ secrets.QC_OANDA_ACCOUNT_ID }} -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 }}
45-
shell: bash
46-
run: |
47-
# Build
48-
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.OandaBrokerage.sln && \
49-
# Run Tests
50-
dotnet test ./QuantConnect.OandaBrokerage.Tests/bin/Release/QuantConnect.OandaBrokerage.Tests.dll
47+
- name: Run build and tests
48+
run: |
49+
# Build
50+
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.OandaBrokerage.sln && \
51+
# Run Tests
52+
dotnet test ./QuantConnect.OandaBrokerage.Tests/bin/Release/QuantConnect.OandaBrokerage.Tests.dll
53+

0 commit comments

Comments
 (0)