Run CI on self-hosted runners #51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Test | |
| on: | |
| push: | |
| branches: ['*'] | |
| pull_request: | |
| branches: [master] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| container: | |
| image: quantconnect/lean:foundation | |
| options: --cpus 12 --memory 12g | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Checkout Lean Same Branch | |
| id: lean-same-branch | |
| uses: actions/checkout@v2 | |
| continue-on-error: true | |
| with: | |
| ref: ${{ github.ref }} | |
| repository: QuantConnect/Lean | |
| path: Lean | |
| - name: Checkout Lean Master | |
| if: steps.lean-same-branch.outcome != 'success' | |
| uses: actions/checkout@v2 | |
| with: | |
| repository: QuantConnect/Lean | |
| path: Lean | |
| - name: Move Lean | |
| run: mv Lean ../Lean | |
| - name: Run build and tests | |
| run: | | |
| # BuildDataSource | |
| dotnet build ./QuantConnect.DataSource.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \ | |
| # BuildTests | |
| dotnet build ./tests/Tests.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \ | |
| # Run Tests | |
| dotnet test ./tests/bin/Release/net9.0/Tests.dll | |