Skip to content

Commit

Permalink
Add basic webapi backend
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikPieper committed Sep 24, 2024
1 parent ab812a3 commit 6f45066
Show file tree
Hide file tree
Showing 33 changed files with 2,053 additions and 30 deletions.
16 changes: 12 additions & 4 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {}
{
"version": 1,
"isRoot": true,
"tools": {
"swashbuckle.aspnetcore.cli": {
"version": "6.8.0",
"commands": [
"swagger"
],
"rollForward": false
}
}
}
53 changes: 29 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
name: CI
name: 'Build'

on:
push:
branches:
- main
pull_request:

permissions:
actions: read
contents: read
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'

jobs:
main:
build:
name: Build
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_ADD_GLOBAL_TOOLS_TO_PATH: false
DOTNET_MULTILEVEL_LOOKUP: 0

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

# This enables task distribution via Nx Cloud
# Run this command as early as possible, before dependencies are installed
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
- run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

# Cache node_modules
- uses: actions/setup-node@v4
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 20
cache: 'npm'
node-version: 12.x
- name: Install Nx dependencies
run: npm install

- run: npm ci --legacy-peer-deps
- uses: nrwl/nx-set-shas@v4
- name: Build
run: npm build

# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: npx nx-cloud record -- echo Hello World
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
- run: npx nx affected -t lint test build
- name: Test
run: npm test
37 changes: 37 additions & 0 deletions angular-dotnet-demo.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "apps", "apps", "{AB16FF10-C7B6-4B06-BA4E-3EE6361F3B7B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AngularDotnetDemo.Backend.Test", "apps\backend.Test\AngularDotnetDemo.Backend.Test.csproj", "{B1E999B0-06B0-499B-9176-BA0247C44B43}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AngularDotnetDemo.Backend", "apps\backend\AngularDotnetDemo.Backend.csproj", "{2E8D52C1-4416-47F7-9099-57D2F3066340}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B1E999B0-06B0-499B-9176-BA0247C44B43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1E999B0-06B0-499B-9176-BA0247C44B43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1E999B0-06B0-499B-9176-BA0247C44B43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1E999B0-06B0-499B-9176-BA0247C44B43}.Release|Any CPU.Build.0 = Release|Any CPU
{2E8D52C1-4416-47F7-9099-57D2F3066340}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E8D52C1-4416-47F7-9099-57D2F3066340}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E8D52C1-4416-47F7-9099-57D2F3066340}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E8D52C1-4416-47F7-9099-57D2F3066340}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{B1E999B0-06B0-499B-9176-BA0247C44B43} = {AB16FF10-C7B6-4B06-BA4E-3EE6361F3B7B}
{2E8D52C1-4416-47F7-9099-57D2F3066340} = {AB16FF10-C7B6-4B06-BA4E-3EE6361F3B7B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4F8F832D-7302-409E-A3D7-322E715E4545}
EndGlobalSection
EndGlobal
28 changes: 28 additions & 0 deletions apps/backend.Test/AngularDotnetDemo.Backend.Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.9.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<Using Include="NUnit.Framework" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\backend\AngularDotnetDemo.Backend.csproj" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions apps/backend.Test/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace AngularDotnetDemo.Backend.Test;

public class Tests
{
[SetUp]
public void Setup()
{
}

[Test]
public void Test1()
{
Assert.Pass();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"format": 1,
"restore": {
"/var/folders/cy/_5zxcdzx1t1c6krfsrlsfrym0000gn/T/tmp-92377-6GJRxL0HANn1/AngularDotnetDemo.Backend.Test.csproj": {}
},
"projects": {
"/var/folders/cy/_5zxcdzx1t1c6krfsrlsfrym0000gn/T/tmp-92377-6GJRxL0HANn1/AngularDotnetDemo.Backend.Test.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/var/folders/cy/_5zxcdzx1t1c6krfsrlsfrym0000gn/T/tmp-92377-6GJRxL0HANn1/AngularDotnetDemo.Backend.Test.csproj",
"projectName": "AngularDotnetDemo.Backend.Test",
"projectPath": "/var/folders/cy/_5zxcdzx1t1c6krfsrlsfrym0000gn/T/tmp-92377-6GJRxL0HANn1/AngularDotnetDemo.Backend.Test.csproj",
"packagesPath": "/Users/dominikpieper/.nuget/packages/",
"outputPath": "/var/folders/cy/_5zxcdzx1t1c6krfsrlsfrym0000gn/T/tmp-92377-6GJRxL0HANn1/obj/",
"projectStyle": "PackageReference",
"configFilePaths": ["/Users/dominikpieper/.nuget/NuGet/NuGet.Config"],
"originalTargetFrameworks": ["net8.0"],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": ["NU1605"]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"Microsoft.NET.Test.Sdk": {
"target": "Package",
"version": "[17.8.0, )"
},
"NUnit": {
"target": "Package",
"version": "[3.14.0, )"
},
"NUnit.Analyzers": {
"target": "Package",
"version": "[3.9.0, )"
},
"NUnit3TestAdapter": {
"target": "Package",
"version": "[4.5.0, )"
},
"coverlet.collector": {
"target": "Package",
"version": "[6.0.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/8.0.401/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/dominikpieper/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/dominikpieper/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.11.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="/Users/dominikpieper/.nuget/packages/" />
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)nunit3testadapter/4.5.0/build/netcoreapp3.1/NUnit3TestAdapter.props" Condition="Exists('$(NuGetPackageRoot)nunit3testadapter/4.5.0/build/netcoreapp3.1/NUnit3TestAdapter.props')" />
<Import Project="$(NuGetPackageRoot)nunit/3.14.0/build/NUnit.props" Condition="Exists('$(NuGetPackageRoot)nunit/3.14.0/build/NUnit.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.testplatform.testhost/17.8.0/build/netcoreapp3.1/Microsoft.TestPlatform.TestHost.props" Condition="Exists('$(NuGetPackageRoot)microsoft.testplatform.testhost/17.8.0/build/netcoreapp3.1/Microsoft.TestPlatform.TestHost.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage/17.8.0/build/netstandard2.0/Microsoft.CodeCoverage.props" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage/17.8.0/build/netstandard2.0/Microsoft.CodeCoverage.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk/17.8.0/build/netcoreapp3.1/Microsoft.NET.Test.Sdk.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk/17.8.0/build/netcoreapp3.1/Microsoft.NET.Test.Sdk.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgNUnit_Analyzers Condition=" '$(PkgNUnit_Analyzers)' == '' ">/Users/dominikpieper/.nuget/packages/nunit.analyzers/3.9.0</PkgNUnit_Analyzers>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)netstandard.library/2.0.0/build/netstandard2.0/NETStandard.Library.targets" Condition="Exists('$(NuGetPackageRoot)netstandard.library/2.0.0/build/netstandard2.0/NETStandard.Library.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage/17.8.0/build/netstandard2.0/Microsoft.CodeCoverage.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage/17.8.0/build/netstandard2.0/Microsoft.CodeCoverage.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk/17.8.0/build/netcoreapp3.1/Microsoft.NET.Test.Sdk.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk/17.8.0/build/netcoreapp3.1/Microsoft.NET.Test.Sdk.targets')" />
<Import Project="$(NuGetPackageRoot)coverlet.collector/6.0.0/build/netstandard1.0/coverlet.collector.targets" Condition="Exists('$(NuGetPackageRoot)coverlet.collector/6.0.0/build/netstandard1.0/coverlet.collector.targets')" />
</ImportGroup>
</Project>
Loading

0 comments on commit 6f45066

Please sign in to comment.