Skip to content

Commit

Permalink
Fix Github actions, update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Oct 22, 2024
1 parent 0d4f2b7 commit 169bb1f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 35 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
push:
branches: [ main ]
branches: [ "main" ]
pull_request:
branches: [ main ]
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Set GitHub package source
run: dotnet nuget add source --username JKorf --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/JKorf/index.json"
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# name: Integration Testing
name: Integration Testing

# on:
# schedule:
# - cron: "0 0 * * *"
#
# jobs:
# build:
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
# - name: Setup .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 6.0.x
# - name: Set GitHub package source
# run: dotnet nuget add source --username JKorf --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/JKorf/index.json"
# - name: Restore dependencies
# run: dotnet restore
# - name: Build
# run: dotnet build --no-restore
# - name: Test
# run: dotnet test --no-build --verbosity normal -e INTEGRATION=1
on:
schedule:
- cron: "0 0 * * *"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Set GitHub package source
run: dotnet nuget add source --username JKorf --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/JKorf/index.json"
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal -e INTEGRATION=1
2 changes: 1 addition & 1 deletion Examples/CryptoCom.Api/CryptoCom.Examples.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CryptoCom.Net" Version="1.0.0" />
<PackageReference Include="CryptoCom.Net" Version="1.0.1" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Examples/CryptoCom.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
// Map the endpoint and inject the rest client
app.MapGet("/{Symbol}", async ([FromServices] ICryptoComRestClient client, string symbol) =>
{
var result = await client.ExchangeApi.ExchangeData.GetTickerAsync(symbol);
return result.Data.LastPrice;
var result = await client.ExchangeApi.ExchangeData.GetTickersAsync(symbol);
return result.Data?.SingleOrDefault()?.LastPrice;
})
.WithOpenApi();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CryptoCom.Net" Version="1.0.0" />
<PackageReference Include="CryptoCom.Net" Version="1.0.1" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions Examples/CryptoCom.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

// REST
var restClient = new CryptoComRestClient();
var ticker = await restClient.ExchangeApi.ExchangeData.GetTickerAsync("ETH_USD");
Console.WriteLine($"Rest client ticker price for ETH_USD: {ticker.Data.LastPrice}");
var ticker = await restClient.ExchangeApi.ExchangeData.GetTickersAsync("ETH_USD");
Console.WriteLine($"Rest client ticker price for ETH_USD: {ticker.Data.Single().LastPrice}");

Console.WriteLine();
Console.WriteLine("Press enter to start websocket subscription");
Expand Down

0 comments on commit 169bb1f

Please sign in to comment.