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

feat: Add GitHub Codespaces configuration (Dev Container) #735

Merged
merged 18 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from 15 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
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"image": "ubuntu:22.04",
HofmeisterAn marked this conversation as resolved.
Show resolved Hide resolved
"containerEnv": {
"DOTNET_CLI_TELEMETRY_OPTOUT": "true",
"DOTNET_NOLOGO": "true",
"DOTNET_SKIP_FIRST_TIME_EXPERIENCE": "true",
"DOTNET_USE_POLLING_FILE_WATCHER": "true",
"NUGET_XMLDOC_MODE": "skip"
},
"forwardPorts": [
2375,
2376
],
HofmeisterAn marked this conversation as resolved.
Show resolved Hide resolved
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/git-lfs:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true
},
"ghcr.io/devcontainers/features/dotnet:1": {
"version": "6.0.405",
"installUsingApt": false
}
},
"extensions": [
"formulahendry.dotnet-test-explorer",
"ms-azuretools.vscode-docker",
"ms-dotnettools.csharp"
],
"settings": {
"omnisharp.path": "latest" // https://github.com/OmniSharp/omnisharp-vscode/issues/5410#issuecomment-1284531542.
},
"postCreateCommand": "git config --system --add safe.directory ${containerWorkspaceFolder}",
"postStartCommand": "git lfs pull && dotnet build"
}
2 changes: 2 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_USE_POLLING_FILE_WATCHER: true
NUGET_XMLDOC_MODE: skip
TZ: CET # https://stackoverflow.com/q/53510011

jobs:
Expand Down
6 changes: 0 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
<Project>
<PropertyGroup>
<SolutionDir Condition=" '$(SolutionDir)' == '' ">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), Testcontainers.sln))/</SolutionDir>
<BuildDir>$(SolutionDir)build/</BuildDir>
<BaseIntermediateOutputPath>$(BuildDir)obj/$(MSBuildProjectName)</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)</IntermediateOutputPath>
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
<OutputPath>$(BuildDir)bin/$(Platform)/$(Configuration)/$(TargetFramework)</OutputPath>
<OutDir>$(OutputPath)/</OutDir>
</PropertyGroup>
<PropertyGroup>
<PackageId>$(AssemblyName)</PackageId>
Expand Down
9 changes: 5 additions & 4 deletions Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
<PackageReference Update="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="all" />
<PackageReference Update="Docker.DotNet" Version="3.125.12" />
<PackageReference Update="Docker.DotNet.X509" Version="3.125.12" />
<PackageReference Update="Microsoft.Extensions.Logging.Abstractions" Version="3.1.31" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Logging.Abstractions" Version="6.0.3" />
<PackageReference Update="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Update="SharpZipLib" Version="1.4.1" />
<PackageReference Update="System.Text.Json" Version="4.7.2" />
<PackageReference Update="System.Text.Json" Version="6.0.7" />
<!-- Unit and integration test dependencies: -->
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Update="coverlet.msbuild" Version="3.2.0" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Update="xunit" Version="2.4.2" />
Expand All @@ -32,6 +33,6 @@
<PackageReference Update="Pomelo.EntityFrameworkCore.MySql" Version="6.0.2" />
<PackageReference Update="RabbitMQ.Client" Version="6.2.4" />
<PackageReference Update="StackExchange.Redis" Version="2.6.48" />
<PackageReference Update="System.Data.SqlClient" Version="4.8.3" />
<PackageReference Update="System.Data.SqlClient" Version="4.8.5" />
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ Task("Tests")
Filter = param.TestFilter,
ResultsDirectory = param.Paths.Directories.TestResultsDirectoryPath,
ArgumentCustomization = args => args
.Append("/p:Platform=AnyCPU")
.Append("/p:CollectCoverage=true")
.Append("/p:CoverletOutputFormat=\"json%2copencover\"") // https://github.com/coverlet-coverage/coverlet/pull/220#issuecomment-431507570.
.Append($"/p:MergeWith=\"{MakeAbsolute(param.Paths.Directories.TestCoverageDirectoryPath)}/coverage.net6.0.json\"")
Expand Down Expand Up @@ -142,7 +141,6 @@ Task("Create-NuGet-Packages")
IncludeSymbols = true,
OutputDirectory = param.Paths.Directories.NuGetDirectoryPath,
ArgumentCustomization = args => args
.Append("/p:Platform=AnyCPU")
.Append("/p:SymbolPackageFormat=snupkg")
.Append($"/p:Version={param.Version}")
});
Expand Down
6 changes: 0 additions & 6 deletions examples/WeatherForecast/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
<Project>
<PropertyGroup>
<SolutionDir Condition=" '$(SolutionDir)' == '' ">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), WeatherForecast.sln))/</SolutionDir>
<BuildDir>$(SolutionDir)build/</BuildDir>
<BaseIntermediateOutputPath>$(BuildDir)obj/$(MSBuildProjectName)</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)</IntermediateOutputPath>
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
<OutputPath>$(BuildDir)bin/$(Platform)/$(Configuration)/$(TargetFramework)</OutputPath>
<OutDir>$(OutputPath)/</OutDir>
</PropertyGroup>
<PropertyGroup>
<Version>0.1.0</Version>
Expand Down
18 changes: 9 additions & 9 deletions examples/WeatherForecast/Packages.props
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<PackageReference Update="JetBrains.Annotations" Version="2022.1.0"/>
<PackageReference Update="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.10"/>
<PackageReference Update="Microsoft.EntityFrameworkCore" Version="6.0.10"/>
<PackageReference Update="Microsoft.Fast.Components.FluentUI" Version="1.5.3"/>
<PackageReference Update="Testcontainers" Version="2.3.0-beta.3547636764"/>
<PackageReference Update="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="all"/>
<PackageReference Update="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.13"/>
<PackageReference Update="Microsoft.EntityFrameworkCore" Version="6.0.13"/>
<PackageReference Update="Microsoft.Fast.Components.FluentUI" Version="2.0.1"/>
<PackageReference Update="Testcontainers" Version="2.3.0"/>
<PackageReference Update="System.ComponentModel.Annotations" Version="5.0.0"/>
<PackageReference Update="System.Text.Json" Version="6.0.6"/>
<PackageReference Update="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.10"/>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.3.2"/>
<PackageReference Update="System.Text.Json" Version="6.0.7"/>
<PackageReference Update="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.13"/>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.4.1"/>
<PackageReference Update="Selenium.WebDriver.ChromeDriver" Version="106.0.5249.6100"/>
<PackageReference Update="Selenium.WebDriver" Version="4.5.1"/>
<PackageReference Update="Selenium.WebDriver" Version="4.7.0"/>
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.5"/>
<PackageReference Update="xunit" Version="2.4.2"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
@using WeatherForecast.Entities
@using System.Collections.Immutable
@using System.Collections.ObjectModel
@using System.Globalization
@using WeatherForecast.Entities
@using WeatherForecast.Interactors
@using WeatherForecast.Interactors.SearchCityOrZipCode
@using System.Globalization
@implements IDisposable

@inject ISearchCityOrZipCode SearchCityOrZipCode

<FluentCard>
<div style="padding: 0 10px 10px">
<h1>Weather Forecast</h1>
<FluentDataGrid RowsData="@_weatherData.ToList()" ColumnDefinitions="@_weatherDataColumnDefinitions">
<RowItemTemplate>
<FluentDataGridRow>
<FluentDataGridCell GridColumn="1">
@context.Date.ToShortDateString()
</FluentDataGridCell>
<FluentDataGridCell GridColumn="2">
@context.Temperatures.Average(temperature => temperature.Value).ToString("0")
</FluentDataGridCell>
</FluentDataGridRow>
</RowItemTemplate>
<FluentDataGrid RowsData="@_weatherData.AsQueryable()">
<PropertyColumn Title="Date" Property="@(item => item.Date.ToShortDateString())"/>
<PropertyColumn Title="Avg °C" Property="@(item => item.Temperatures.Average(temperature => temperature.Value).ToString("0"))"/>
</FluentDataGrid>

@{
if (_weatherData.Any())
{
<p>The weather forecast shows the next <span>@_weatherData.Count()</span> days.</p>
<p>The weather forecast shows the next <span>@_weatherData.Count</span> days.</p>
}
else
{
Expand All @@ -39,13 +33,7 @@

@code
{
private IEnumerable<ColumnDefinition<WeatherData>> _weatherDataColumnDefinitions = new[]
{
new ColumnDefinition<WeatherData>("Date", _ => _),
new ColumnDefinition<WeatherData>("Avg °C", _ => _)
};

private IEnumerable<WeatherData> _weatherData = Array.Empty<WeatherData>();
private ImmutableList<WeatherData> _weatherData = ImmutableList<WeatherData>.Empty;

protected override void OnInitialized()
{
Expand All @@ -62,7 +50,7 @@
{
if (result.IsSuccessful)
{
_weatherData = result.Value;
_weatherData = ImmutableList<WeatherData>.Empty.AddRange(result.Value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<PackageReference Include="xunit"/>
</ItemGroup>
<ItemGroup>
<!-- https://github.com/dotnet/sdk/issues/17645 -->
<ProjectReference Include="$(SolutionDir)src/WeatherForecast/WeatherForecast.csproj" Private="False"/>
<ProjectReference Include="$(SolutionDir)src/WeatherForecast/WeatherForecast.csproj"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<PackageReference Include="xunit"/>
</ItemGroup>
<ItemGroup>
<!-- https://github.com/dotnet/sdk/issues/17645 -->
<ProjectReference Include="$(SolutionDir)src/WeatherForecast/WeatherForecast.csproj" Private="False"/>
<ProjectReference Include="$(SolutionDir)src/WeatherForecast/WeatherForecast.csproj"/>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Testcontainers/Testcontainers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
<RootNamespace>DotNet.Testcontainers</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" />
<PackageReference Include="Docker.DotNet" />
<PackageReference Include="Docker.DotNet.X509" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Portable.BouncyCastle" />
<PackageReference Include="SharpZipLib" />
Expand Down
1 change: 0 additions & 1 deletion tests/Testcontainers.Commons/Testcontainers.Commons.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
<RootNamespace>DotNet.Testcontainers.Commons</RootNamespace>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
Expand All @@ -14,7 +13,6 @@
<PackageReference Include="xunit" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)src/Testcontainers/Testcontainers.csproj" />
<ProjectReference Include="$(SolutionDir)tests/Testcontainers.Commons/Testcontainers.Commons.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
Expand All @@ -14,7 +13,6 @@
<PackageReference Include="xunit" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)src/Testcontainers/Testcontainers.csproj" />
<ProjectReference Include="$(SolutionDir)tests/Testcontainers.Commons/Testcontainers.Commons.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
<RootNamespace>DotNet.Testcontainers.ResourceReaper.Tests</RootNamespace>
</PropertyGroup>
<ItemGroup>
Expand All @@ -15,7 +14,6 @@
<PackageReference Include="xunit" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)src/Testcontainers/Testcontainers.csproj" />
<ProjectReference Include="$(SolutionDir)tests/Testcontainers.Commons/Testcontainers.Commons.csproj" />
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions tests/Testcontainers.Tests/Testcontainers.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
<RootNamespace>DotNet.Testcontainers.Tests</RootNamespace>
</PropertyGroup>
<ItemGroup>
Expand All @@ -32,7 +31,6 @@
<PackageReference Include="System.Data.SqlClient" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)src/Testcontainers/Testcontainers.csproj" />
<ProjectReference Include="$(SolutionDir)tests/Testcontainers.Commons/Testcontainers.Commons.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down