diff --git a/.github/workflows/gh-actions.yml b/.github/workflows/gh-actions.yml index 36ed679..9759804 100644 --- a/.github/workflows/gh-actions.yml +++ b/.github/workflows/gh-actions.yml @@ -9,10 +9,12 @@ on: jobs: build: runs-on: ubuntu-20.04 - container: - image: quantconnect/lean:foundation steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 + + - name: Free space + run: df -h && rm -rf /opt/hostedtoolcache* && df -h - name: Checkout Lean Same Branch id: lean-same-branch @@ -33,8 +35,14 @@ jobs: - name: Move Lean run: mv Lean ../Lean - - name: Build - run: dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.SamcoBrokerage.sln - - - name: Run Tests - run: dotnet test ./QuantConnect.SamcoBrokerage.Tests/bin/Release/QuantConnect.SamcoBrokerage.Tests.dll + - name: Build and Run + uses: addnab/docker-run-action@v3 + with: + image: quantconnect/lean:foundation + options: --workdir /__w/Lean.Brokerages.Samco/Lean.Brokerages.Samco -v /home/runner/work:/__w + shell: bash + run: | + # Build + dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.SamcoBrokerage.sln + # Run Tests + dotnet test ./QuantConnect.SamcoBrokerage.Tests/bin/Release/QuantConnect.SamcoBrokerage.Tests.dll diff --git a/QuantConnect.SamcoBrokerage.Tests/SamcoBrokerageTests.cs b/QuantConnect.SamcoBrokerage.Tests/SamcoBrokerageTests.cs index 80d8c6a..b417727 100644 --- a/QuantConnect.SamcoBrokerage.Tests/SamcoBrokerageTests.cs +++ b/QuantConnect.SamcoBrokerage.Tests/SamcoBrokerageTests.cs @@ -68,7 +68,7 @@ protected override IBrokerage CreateBrokerage(IOrderProvider orderProvider, ISec var algorithm = new Mock(); algorithm.Setup(a => a.Transactions).Returns(transactions); algorithm.Setup(a => a.BrokerageModel).Returns(new SamcoBrokerageModel()); - algorithm.Setup(a => a.Portfolio).Returns(new SecurityPortfolioManager(securities, transactions)); + algorithm.Setup(a => a.Portfolio).Returns(new SecurityPortfolioManager(securities, transactions, new AlgorithmSettings())); var apiSecret = Config.Get("samco-client-password"); var apiKey = Config.Get("samco-client-id"); diff --git a/QuantConnect.SamcoBrokerage.Tests/SamcoSymbolMapperTests.cs b/QuantConnect.SamcoBrokerage.Tests/SamcoSymbolMapperTests.cs index 6b66ba2..3207034 100644 --- a/QuantConnect.SamcoBrokerage.Tests/SamcoSymbolMapperTests.cs +++ b/QuantConnect.SamcoBrokerage.Tests/SamcoSymbolMapperTests.cs @@ -43,7 +43,7 @@ public void GetExchangeWithListingID(string listingID, string expectedExchange) } [TestCase("tcs")] - [TestCase("hdfc")] + [TestCase("ltts")] public void IsKnownBrokerageSymbol(string symbol) { Assert.IsTrue(_symbolMapper.IsKnownBrokerageSymbol(symbol)); diff --git a/QuantConnect.SamcoBrokerage/SamcoBrokerage.cs b/QuantConnect.SamcoBrokerage/SamcoBrokerage.cs index 0d5bbdb..794509e 100644 --- a/QuantConnect.SamcoBrokerage/SamcoBrokerage.cs +++ b/QuantConnect.SamcoBrokerage/SamcoBrokerage.cs @@ -1142,10 +1142,10 @@ private static void ValidateSubscription() { try { - var productId = 173; - var userId = Config.GetInt("job-user-id"); - var token = Config.Get("api-access-token"); - var organizationId = Config.Get("job-organization-id", null); + const int productId = 173; + var userId = Globals.UserId; + var token = Globals.UserToken; + var organizationId = Globals.OrganizationID; // Verify we can authenticate with this user and token var api = new ApiConnection(userId, token); if (!api.Connected)