Skip to content

Update CI to run demo algorithms #129

Update CI to run demo algorithms

Update CI to run demo algorithms #129

Workflow file for this run

name: Build & Test
on:
push:
branches: ['*']
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Copy sample data to LEAN Data folder
run: cp -r ../Lean.DataSource.SDK/output/* ../Lean/Data/
- name: Start container
run: |
docker run -d \
--workdir /__w/Lean.DataSource.SDK/Lean.DataSource.SDK \
-v /home/runner/work:/__w \
--name test-container \
quantconnect/lean:foundation \
tail -f /dev/null
- name: Build DataSource
run: runInContainer dotnet build ./QuantConnect.DataSource.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1
- name: Build Tests
run: runInContainer dotnet build ./tests/Tests.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1
- name: Run Tests
run: runInContainer dotnet test ./tests/bin/Release/net10.0/Tests.dll
- name: Run C# Demo Algorithm
run: |
cat > ../Lean.DataSource.SDK/demo-csharp-config.json << 'EOF'
{
"algorithm-type-name": "Demonstration",
"algorithm-language": "CSharp",
"algorithm-location": "tests/bin/Release/net10.0/Tests.dll",
"data-folder": "../Lean/Data/"
}
EOF
runInContainer dotnet run --project ../Lean/Launcher/QuantConnect.Lean.Launcher.csproj --configuration Release -- --config ./demo-csharp-config.json
- name: Run Python Demo Algorithm
run: |
cat > ../Lean.DataSource.SDK/demo-python-config.json << 'EOF'
{
"algorithm-type-name": "Demonstration",
"algorithm-language": "Python",
"algorithm-location": "Demonstration.py",
"data-folder": "../Lean/Data/"
}
EOF
runInContainer dotnet run --project ../Lean/Launcher/QuantConnect.Lean.Launcher.csproj --configuration Release -- --config ./demo-python-config.json
- name: Run C# Universe Demo Algorithm
run: |
cat > ../Lean.DataSource.SDK/demo-csharp-config.json << 'EOF'
{
"algorithm-type-name": "DemonstrationUniverse",
"algorithm-language": "CSharp",
"algorithm-location": "tests/bin/Release/net10.0/Tests.dll",
"data-folder": "../Lean/Data/"
}
EOF
runInContainer dotnet run --project ../Lean/Launcher/QuantConnect.Lean.Launcher.csproj --configuration Release -- --config ./demo-csharp-config.json
- name: Run Python Universe Demo Algorithm
run: |
cat > ../Lean.DataSource.SDK/demo-python-config.json << 'EOF'
{
"algorithm-type-name": "DemonstrationUniverse",
"algorithm-language": "Python",
"algorithm-location": "DemonstrationUniverse.py",
"data-folder": "../Lean/Data/"
}
EOF
runInContainer dotnet run --project ../Lean/Launcher/QuantConnect.Lean.Launcher.csproj --configuration Release -- --config ./demo-python-config.json
- name: Stop container
run: docker rm -f test-container
rename:
needs: build
uses: ./.github/workflows/rename-build.yml