Skip to content

Commit

Permalink
update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed May 9, 2024
1 parent 4673367 commit 8fd0c53
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 104 deletions.
66 changes: 54 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,57 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "01:00"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "01:00"
timezone: "America/Chicago"
open-pull-requests-limit: 10

- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
time: "02:00"
timezone: "America/Chicago"
open-pull-requests-limit: 10
groups:
Azure:
patterns:
- "Azure.*"
- "Microsoft.Azure.*"
- "Microsoft.Extensions.Azure"
AspNetCoreHealthChecks:
patterns:
- "AspNetCore.HealthChecks.*"
AspNetCore:
patterns:
- "Microsoft.AspNetCore.*"
- "Microsoft.Extensions.Features"
MicrosoftExtensions:
patterns:
- "Microsoft.Extensions.*"
EntityFrameworkCore:
patterns:
- "Microsoft.EntityFrameworkCore.*"
OpenTelemetry:
patterns:
- "OpenTelemetry.*"
Serilog:
patterns:
- "Serilog"
- "Serilog.*"
Hangfire:
patterns:
- "Hangfire"
- "Hangfire.*"
Testcontainers:
patterns:
- "Testcontainers.*"
xUnit:
patterns:
- "xunit"
- "xunit.assert"
- "xunit.core"
- "xunit.extensibility.*"
- "xunit.runner.*"
151 changes: 71 additions & 80 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_ENVIRONMENT: github
ASPNETCORE_ENVIRONMENT: github
BUILD_PATH: '${{github.workspace}}/artifacts'
BUILD_PATH: "${{github.workspace}}/artifacts"
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

on:
Expand All @@ -14,101 +14,92 @@ on:
- main
- develop
tags:
- 'v*'
- "v*"
pull_request:
branches:
- main
- develop

jobs:

build:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore Dependencies
run: dotnet restore

- name: Build Solution
run: dotnet build --no-restore --configuration Release

- name: Start Cosmos DB
shell: pwsh
run: |
Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
Start-CosmosDbEmulator
- name: Run Test
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings

- name: Generate Coverage
uses: danielpalme/[email protected]
with:
reports: '${{github.workspace}}/test/*/TestResults/*/coverage.info'
targetdir: ${{env.BUILD_PATH}}
reporttypes: lcov

- name: Report Coverage
if: success()
uses: coverallsapp/github-action@v2
with:
file: '${{env.BUILD_PATH}}/lcov.info'
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore Dependencies
run: dotnet restore

- name: Build Solution
run: dotnet build --no-restore --configuration Release

- name: Start Cosmos DB
shell: pwsh
run: |
Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
Start-CosmosDbEmulator
- name: Run Test
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings

- name: Report Coverage
if: success()
uses: coverallsapp/github-action@v2
with:
file: "${{github.workspace}}/test/*/TestResults/*/coverage.info"
format: lcov

- name: Create Packages
if: success() && github.event_name != 'pull_request'
run: dotnet pack --configuration Release --include-symbols --include-source --no-build --no-restore --output "${{env.BUILD_PATH}}"
- name: Create Packages
if: success() && github.event_name != 'pull_request'
run: dotnet pack --configuration Release --no-build --output "${{env.BUILD_PATH}}"

- name: Upload Packages
if: success() && github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: packages
path: '${{env.BUILD_PATH}}'
- name: Upload Packages
if: success() && github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: packages
path: "${{env.BUILD_PATH}}"

deploy:
runs-on: ubuntu-latest
needs: build
if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))

steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: packages

- name: Publish Packages GitHub
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
done
- name: Publish Packages feedz
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate
done
- name: Publish Packages Nuget
if: startsWith(github.ref, 'refs/tags/v')
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
done
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: packages

- name: Publish Packages GitHub
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
done
- name: Publish Packages feedz
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate
done
- name: Publish Packages Nuget
if: startsWith(github.ref, 'refs/tags/v')
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
done
2 changes: 2 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<PropertyGroup Label="Debug">
<DebugType>embedded</DebugType>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>false</IncludeSymbols>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
Expand All @@ -37,6 +38,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AssemblyMetadata.Generators" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions test/Cosmos.Abstracts.Tests/Cosmos.Abstracts.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="35.5.0" />
<PackageReference Include="Bogus" Version="35.5.1" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="XUnit.Hosting" Version="1.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="XUnit.Hosting" Version="1.6.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
13 changes: 5 additions & 8 deletions test/Cosmos.Abstracts.Tests/DatabaseFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

using XUnit.Hosting;

namespace Cosmos.Abstracts.Tests;

public class DatabaseFixture : TestHostFixture
public class DatabaseFixture : TestApplicationFixture
{
protected override void ConfigureLogging(HostBuilderContext context, ILoggingBuilder builder)
protected override void ConfigureApplication(HostApplicationBuilder builder)
{
base.ConfigureLogging(context, builder);
builder.SetMinimumLevel(LogLevel.Debug);
}
base.ConfigureApplication(builder);

var services = builder.Services;

protected override void ConfigureServices(HostBuilderContext context, IServiceCollection services)
{
services.AddCosmosRepository();

services.TryAddSingleton<IUserRepository, UserRepository>();
Expand Down

0 comments on commit 8fd0c53

Please sign in to comment.