Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New methods, dependency upgrades, and code formatting improvements #9

Merged
merged 4 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
363 changes: 363 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

23 changes: 19 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ on:
- '*'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+.*'
pull_request:
pull_request:
workflow_dispatch:

env:
VERSION: 0.0.0
ConnectionStrings__Test: ${{ secrets.TEST_CONNECTION_STRING }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }} # This checks out the commit that triggered the workflow run

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand All @@ -39,18 +39,33 @@ jobs:
- name: Restore dependencies
run: dotnet restore

- name: Verify Format
run: dotnet format --verify-no-changes --verbosity diagnostic

- name: Build
run: dotnet build --no-restore --configuration Release /p:Version=${{ env.VERSION }} /p:CopyrightYear=$(date +%Y)

- name: Test (latest pgmq version)
run: Npgmq.Test/scripts/run-tests.sh

- name: Test (pgmq 1.4.5)
run: Npgmq.Test/scripts/run-tests.sh 1.4.5

- name: Test (pgmq 1.3.3)
run: Npgmq.Test/scripts/run-tests.sh 1.3.3

- name: Test (pgmq 1.2.1)
run: Npgmq.Test/scripts/run-tests.sh 1.2.1

- name: Test (pgmq 1.1.1)
run: Npgmq.Test/scripts/run-tests.sh 1.1.1

- name: Test (pgmq 1.0.0)
run: Npgmq.Test/scripts/run-tests.sh 1.0.0

- name: Test (pgmq 0.33.1)
run: Npgmq.Test/scripts/run-tests.sh 0.33.1

- name: Test (pgmq 0.31.0)
run: Npgmq.Test/scripts/run-tests.sh 0.31.0

Expand All @@ -73,7 +88,7 @@ jobs:
with:
name: build-artifact
path: out

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions Npgmq.Example/Npgmq.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions Npgmq.Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
var msg = await npgmq.ReadAsync<MyMessageType>("example_queue");
if (msg != null)
{
Console.WriteLine($"Read message with id {msg.MsgId}: Foo = {msg.Message?.Foo}, Bar = {msg.Message?.Bar}");
Console.WriteLine($"Read message with id {msg.MsgId} (EnqueuedAt = {msg.EnqueuedAt}, Vt = {msg.Vt}): Foo = {msg.Message?.Foo}, Bar = {msg.Message?.Bar}");
await npgmq.ArchiveAsync("example_queue", msg.MsgId);
}
}
Expand Down Expand Up @@ -59,13 +59,13 @@
var msg = await npgmq.ReadAsync<MyMessageType>("example_queue");
if (msg != null)
{
Console.WriteLine($"Read message with id {msg.MsgId}: Foo = {msg.Message?.Foo}, Bar = {msg.Message?.Bar}");
Console.WriteLine($"Read message with id {msg.MsgId} (EnqueuedAt = {msg.EnqueuedAt}, Vt = {msg.Vt}): Foo = {msg.Message?.Foo}, Bar = {msg.Message?.Bar}");
await npgmq.ArchiveAsync("example_queue", msg.MsgId);
}
msg = await npgmq.ReadAsync<MyMessageType>("example_queue");
if (msg != null)
{
Console.WriteLine($"Read message with id {msg.MsgId}: Foo = {msg.Message?.Foo}, Bar = {msg.Message?.Bar}");
Console.WriteLine($"Read message with id {msg.MsgId} (EnqueuedAt = {msg.EnqueuedAt}, Vt = {msg.Vt}): Foo = {msg.Message?.Foo}, Bar = {msg.Message?.Bar}");
await npgmq.ArchiveAsync("example_queue", msg.MsgId);
}
}
Expand Down
15 changes: 8 additions & 7 deletions Npgmq.Test/Npgmq.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.21" />
<PackageReference Include="DeepEqual" Version="4.2.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="DeepEqual" Version="5.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Xunit.SkippableFact" Version="1.5.23" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading