Skip to content

Commit

Permalink
Merge pull request #470 from ChaosEngine/dev
Browse files Browse the repository at this point in the history
Dev -> Master
  • Loading branch information
ChaosEngine authored Jan 6, 2025
2 parents f12c9bd + f0c7555 commit ff526a2
Show file tree
Hide file tree
Showing 31 changed files with 981 additions and 143 deletions.
38 changes: 18 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
jobs:
all-tests:
docker:
- image: mcr.microsoft.com/playwright:next
- image: mcr.microsoft.com/playwright:latest
# Steps to the job
steps:
- checkout
Expand All @@ -14,12 +14,11 @@ jobs:
git submodule update --init --recursive --jobs 8
- run:
name: Install framework
# should be 20.04 but...whatever
command: |
curl -O https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb
apt update && apt install -y dotnet-sdk-8.0
corepack enable
apt update; apt install software-properties-common -y
add-apt-repository ppa:dotnet/backports -y
apt update && apt install -y dotnet-sdk-9.0
corepack enable; corepack install -g pnpm
- run:
name: Show versions
command: |
Expand All @@ -32,7 +31,7 @@ jobs:
dotnet restore
cd DotnetPlayground.Web
pnpm i
npx playwright install
npx playwright install --only-shell chromium
cd ..
- run:
name: Run Unit and Integration Tests
Expand Down Expand Up @@ -62,7 +61,7 @@ jobs:

Pomelo-tests:
docker:
- image: mcr.microsoft.com/dotnet/sdk:8.0
- image: mcr.microsoft.com/dotnet/sdk:9.0
# Steps to the job
steps:
- checkout
Expand Down Expand Up @@ -102,7 +101,7 @@ jobs:

InkBall-tests:
docker:
- image: mcr.microsoft.com/dotnet/sdk:8.0
- image: mcr.microsoft.com/dotnet/sdk:9.0
# Steps to the job
steps:
- checkout
Expand Down Expand Up @@ -142,7 +141,7 @@ jobs:

DotnetPlayground-tests:
docker:
- image: mcr.microsoft.com/dotnet/sdk:8.0
- image: mcr.microsoft.com/dotnet/sdk:9.0
# Steps to the job
steps:
- checkout
Expand Down Expand Up @@ -182,7 +181,7 @@ jobs:

Playwright-tests:
docker:
- image: mcr.microsoft.com/playwright:next
- image: mcr.microsoft.com/playwright:latest
# Steps to the job
steps:
- checkout
Expand All @@ -193,12 +192,11 @@ jobs:
git submodule update --init --recursive --jobs 8
- run:
name: Install framework
# should be 20.04 but...whatever
command: |
curl -O https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb
apt update && apt install -y dotnet-sdk-8.0
corepack enable
apt update; apt install software-properties-common -y
add-apt-repository ppa:dotnet/backports -y
apt update && apt install -y dotnet-sdk-9.0
corepack enable; corepack install -g pnpm
- run:
name: Show versions
command: |
Expand All @@ -211,7 +209,7 @@ jobs:
dotnet restore
cd DotnetPlayground.Web
pnpm i
npx playwright install chromium
npx playwright install --only-shell chromium
cd ..
- run:
name: End-2-End Playwright browser tests
Expand All @@ -225,7 +223,7 @@ jobs:

build:
docker:
- image: mcr.microsoft.com/dotnet/sdk:8.0
- image: mcr.microsoft.com/dotnet/sdk:9.0
# Steps to the job
steps:
- checkout
Expand All @@ -240,9 +238,9 @@ jobs:
command: |
curl -SLO https://deb.nodesource.com/nsolid_setup_deb.sh
chmod 500 nsolid_setup_deb.sh
./nsolid_setup_deb.sh 20
./nsolid_setup_deb.sh 21
apt-get install -y nodejs
corepack enable
corepack enable; corepack install -g pnpm
- run:
name: "Build Application according to some given configuration"
command: dotnet publish -c Release --self-contained -r linux-x64 DotnetPlayground.Web
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-version: '9.x'

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Build with dotnet
env:
DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2
run: dotnet build --configuration Release
- name: Test with dotnet
env:
DBKind: "sqlite"
ConnectionStrings__Sqlite: "Filename=./bin/Debug/net8.0/Blogging.db"
ConnectionStrings__Sqlite: "Filename=./bin/Debug/net9.0/Blogging.db"
DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2
run: dotnet test -v m --configuration Debug
3 changes: 1 addition & 2 deletions .github/workflows/trivy-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/chaosengine/dotnetplayground:${{ github.sha }}'
format: 'template'
template: '@/contrib/sarif.tpl'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'

Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/DotnetPlayground.Web/bin/Debug/net8.0/DotnetPlayground.Web.dll",
"program": "${workspaceFolder}/DotnetPlayground.Web/bin/Debug/net9.0/DotnetPlayground.Web.dll",
"args": [],
"cwd": "${workspaceFolder}/DotnetPlayground.Web",
"stopAtEntry": false,
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# syntax = docker/dockerfile:experimental
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim AS build
RUN --mount=type=cache,target=/root/.nuget --mount=type=cache,target=/root/.local/ --mount=type=cache,target=/root/.cache/ --mount=type=cache,target=./DotnetPlayground.Web/node_modules
RUN curl -SLO https://deb.nodesource.com/nsolid_setup_deb.sh && \
chmod 500 nsolid_setup_deb.sh && \
./nsolid_setup_deb.sh 20 && \
./nsolid_setup_deb.sh 21 && \
apt-get install -y nodejs && npm install -g pnpm
WORKDIR /build

ENV DBKind="sqlite" ConnectionStrings__Sqlite="Filename=./bin/Debug/net8.0/Blogging.db"
ENV DBKind="sqlite" ConnectionStrings__Sqlite="Filename=./bin/Debug/net9.0/Blogging.db"
ARG SOURCE_COMMIT
ARG SOURCE_BRANCH
ARG BUILD_CONFIG=${BUILD_CONFIG:-Release}
Expand Down Expand Up @@ -35,11 +35,11 @@ RUN dotnet publish -c $BUILD_CONFIG --self-contained -r linux-x64 \



FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-bookworm-slim
FROM mcr.microsoft.com/dotnet/runtime-deps:9.0-bookworm-slim
WORKDIR /app
ENV USER=nobody
ARG BUILD_CONFIG=${BUILD_CONFIG:-Release}
COPY --from=build --chown="$USER":"$USER" /build/DotnetPlayground.Web/bin/$BUILD_CONFIG/net8.0/linux-x64/publish/ /build/startApp.sh ./
COPY --from=build --chown="$USER":"$USER" /build/DotnetPlayground.Web/bin/$BUILD_CONFIG/net9.0/linux-x64/publish/ /build/startApp.sh ./

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# syntax = docker/dockerfile:experimental
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
RUN --mount=type=cache,target=/root/.nuget --mount=type=cache,target=/root/.local/ --mount=type=cache,target=/root/.cache/ --mount=type=cache,target=./DotnetPlayground.Web/node_modules
RUN apk add --update nodejs npm && npm install -g pnpm
WORKDIR /build

ENV DBKind="sqlite" ConnectionStrings__Sqlite="Filename=./bin/Debug/net8.0/Blogging.db"
ENV DBKind="sqlite" ConnectionStrings__Sqlite="Filename=./bin/Debug/net9.0/Blogging.db"
ARG SOURCE_COMMIT
ARG SOURCE_BRANCH
ARG BUILD_CONFIG=${BUILD_CONFIG:-Release}
Expand Down Expand Up @@ -32,12 +32,12 @@ RUN dotnet publish -c $BUILD_CONFIG --self-contained -r linux-musl-x64 \



FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine
FROM mcr.microsoft.com/dotnet/runtime-deps:9.0-alpine
RUN apk add tzdata
WORKDIR /app
ENV USER=nobody
ARG BUILD_CONFIG=${BUILD_CONFIG:-Release}
COPY --from=build --chown="$USER":"$USER" /build/DotnetPlayground.Web/bin/$BUILD_CONFIG/net8.0/linux-musl-x64/publish/ /build/startApp.sh ./
COPY --from=build --chown="$USER":"$USER" /build/DotnetPlayground.Web/bin/$BUILD_CONFIG/net9.0/linux-musl-x64/publish/ /build/startApp.sh ./

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

Expand Down
5 changes: 5 additions & 0 deletions DotnetPlayground.Tests/BaseTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using DotnetPlayground.Models;
using InkBall.Module;
using Lib.ServerTiming;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.Data.Sqlite;
Expand Down Expand Up @@ -51,6 +52,7 @@ public CancellationToken CancellationToken
{ "ConnectionStrings:Sqlite", "DataSource=:memory:" },
{ "DBKind", "sqlite" }
});
ContextSnapshotHelper.DBKind = "sqlite";
var config = builder.Build();

var connection = new SqliteConnection(config.GetConnectionString("Sqlite"));
Expand All @@ -60,6 +62,9 @@ public CancellationToken CancellationToken

var options = new DbContextOptionsBuilder<BloggingContext>()
.UseSqlite(connection)
// .ConfigureWarnings(b =>
// b.Ignore(Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning)
// )
.Options;

// Create the schema in the database
Expand Down
16 changes: 8 additions & 8 deletions DotnetPlayground.Tests/DotnetPlayground.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>latest</LangVersion>

<IsPackable>false</IsPackable>
Expand All @@ -10,21 +10,21 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.10" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" 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="2.8.2">
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
44 changes: 22 additions & 22 deletions DotnetPlayground.Web/DotnetPlayground.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<Version>1.0.27-dotnet8</Version>
<TargetFramework>net8.0</TargetFramework>
<Version>1.0.29-dotnet9</Version>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>latest</LangVersion>
<AssemblyName>DotnetPlayground.Web</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>DotnetPlayground.Web</PackageId>
<UserSecretsId>aspnet-DotnetPlayground-20161230022416</UserSecretsId>
<TypeScriptToolsVersion>2.8</TypeScriptToolsVersion>
<TieredCompilation>true</TieredCompilation>
<PublishTrimmed>true</PublishTrimmed>
<!--<PublishTrimmed>true</PublishTrimmed>
<TrimMode>partial</TrimMode>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>-->
<Configurations>Debug;Release;Oracle</Configurations>
</PropertyGroup>

Expand All @@ -37,27 +37,27 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.10">
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="9.0.0">
<ExcludeAssets>buildTransitive</ExcludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.10" Condition="$(DefineConstants.Contains('INCLUDE_SQLSERVER'))" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="8.0.10" Condition="$(DefineConstants.Contains('INCLUDE_SQLSERVER'))" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.10" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.8" Condition="$(DefineConstants.Contains('INCLUDE_POSTGRES'))" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" Condition="$(DefineConstants.Contains('INCLUDE_MYSQL'))" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="8.23.60" Condition="$(DefineConstants.Contains('INCLUDE_ORACLE'))" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" Condition="$(DefineConstants.Contains('INCLUDE_SQLSERVER'))" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="9.0.0" Condition="$(DefineConstants.Contains('INCLUDE_SQLSERVER'))" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.2" Condition="$(DefineConstants.Contains('INCLUDE_POSTGRES'))" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0-preview.3.efcore.9.0.0.ci.20241214050811" Condition="$(DefineConstants.Contains('INCLUDE_MYSQL'))" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="9.23.60" Condition="$(DefineConstants.Contains('INCLUDE_ORACLE'))" />
<PackageReference Include="IdentityManager2.AspNetIdentity" Version="1.0.0" />
<PackageReference Include="Lib.AspNetCore.ServerTiming" Version="6.0.0" />
<!--<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.16.2" Condition="$(DefineConstants.Contains('INCLUDE_COSMOSDB'))" />-->
<PackageReference Include="MongoDB.Driver" Version="2.29.0" Condition="$(DefineConstants.Contains('INCLUDE_MONGODB'))" />
<PackageReference Include="MongoDB.Driver" Version="3.1.0" Condition="$(DefineConstants.Contains('INCLUDE_MONGODB'))" />
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.68.0.3556" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.10" />
<PackageReference Include="MessagePack" Version="2.5.187" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="9.0.0" />
<PackageReference Include="MessagePack" Version="3.1.1" />
</ItemGroup>

<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
Expand All @@ -79,9 +79,9 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)'=='Debug'">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.35" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.36" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Loading

0 comments on commit ff526a2

Please sign in to comment.