Skip to content

Commit

Permalink
Debug workflow (#10)
Browse files Browse the repository at this point in the history
* Try no CA on build

* Reenable?

* more warnings plz

* plz
  • Loading branch information
Pythonic-Rainbow authored Jan 16, 2024
1 parent ac58b5d commit 572599a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
Bot/bin/Release/net8.0/linux-arm64/Bot
Bot/bin/Release/net8.0/linux-arm64/*.dll
Bot/bin/Release/net8.0/linux-arm64/*.json
Bot/bin/Release/net8.0/linux-arm64/runtimes/linux-arm64/*
inspect:
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 8 additions & 0 deletions Bot/Bot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
<AnalysisModeSecurity>All</AnalysisModeSecurity>
</PropertyGroup>

<PropertyGroup Condition="'$(CompileConfig)' == 'DEBUG'">
<RunAnalyzersDuringBuild>False</RunAnalyzersDuringBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(CompileConfig)' == 'RELEASE'">
<RunAnalyzersDuringBuild>True</RunAnalyzersDuringBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClashOfClans" Version="9.0.0" />
<PackageReference Include="Discord.Net.WebSocket" Version="3.13.0" />
Expand Down
4 changes: 2 additions & 2 deletions Bot/Discord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal sealed class Discord
#if DEBUG
private const ulong BotLogId = 666431254312517633;
#else
const ulong BotLogId = 1099026457268863017;
private const ulong BotLogId = 1099026457268863017;
#endif
private static readonly DiscordSocketClient s_bot = new();

Expand Down Expand Up @@ -64,4 +64,4 @@ internal static async Task DonationsChangedAsync(Dictionary<string, DonationTupl
msg += string.Join(", ", items);
await s_botLog.SendMessageAsync(msg);

Check warning on line 65 in Bot/Discord.cs

View workflow job for this annotation

GitHub Actions / inspect

"[IDE0058] Expression value is never used" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Discord.cs(65,1996)

Check warning on line 65 in Bot/Discord.cs

View workflow job for this annotation

GitHub Actions / build

Expression value is never used (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0058)
}
}
}
3 changes: 2 additions & 1 deletion Bot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public static async Task Main()
{
await Discord.InitAsync();
await Coc.InitAsync();
Sql.Db.Init();
await Task.Delay(-1);
}
}
}
9 changes: 9 additions & 0 deletions Bot/Sql/Db.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@ namespace Hyperstellar.Sql;
internal sealed class Db
{
private static readonly SQLiteConnection s_db = new("Hyperstellar.db");

internal static void Init()
{
var x = s_db.Table<User>();

Check warning on line 11 in Bot/Sql/Db.cs

View workflow job for this annotation

GitHub Actions / inspect

"[IDE0008] Use explicit type instead of 'var'" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Sql/Db.cs(11,194)

Check warning on line 11 in Bot/Sql/Db.cs

View workflow job for this annotation

GitHub Actions / build

Use explicit type instead of 'var' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0008)
foreach (var y in x)

Check warning on line 12 in Bot/Sql/Db.cs

View workflow job for this annotation

GitHub Actions / inspect

"[IDE0008] Use explicit type instead of 'var'" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Sql/Db.cs(12,239)

Check warning on line 12 in Bot/Sql/Db.cs

View workflow job for this annotation

GitHub Actions / build

Use explicit type instead of 'var' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0008)

Check warning on line 12 in Bot/Sql/Db.cs

View workflow job for this annotation

GitHub Actions / build

Unnecessary assignment of a value to 'y' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)
{
//Console.WriteLine(y.CocId);
}
}
}
9 changes: 9 additions & 0 deletions Bot/Sql/User.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using SQLite;

namespace Hyperstellar.Sql;
internal class User

Check warning on line 4 in Bot/Sql/User.cs

View workflow job for this annotation

GitHub Actions / build

Type 'User' can be sealed because it has no subtypes in its containing assembly and is not externally visible (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1852)
{
[PrimaryKey]
public string CocId { get; set; }

Check warning on line 7 in Bot/Sql/User.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'CocId' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
public ulong? DiscordId;

Check warning on line 8 in Bot/Sql/User.cs

View workflow job for this annotation

GitHub Actions / build

Field 'User.DiscordId' is never assigned to, and will always have its default value
}

0 comments on commit 572599a

Please sign in to comment.