From 72e410f0a8862b670fb359bd408d2166748538d4 Mon Sep 17 00:00:00 2001 From: Artsiom Date: Fri, 22 Nov 2024 14:16:58 +0100 Subject: [PATCH] Dotnet CI --- .gitea/workflows/ci.yaml | 15 ++++--- Program.cs | 2 + ci.csproj | 10 +++++ main.c | 6 --- obj/ci.csproj.nuget.dgspec.json | 69 ++++++++++++++++++++++++++++++ obj/ci.csproj.nuget.g.props | 15 +++++++ obj/ci.csproj.nuget.g.targets | 2 + obj/project.assets.json | 74 +++++++++++++++++++++++++++++++++ obj/project.nuget.cache | 8 ++++ 9 files changed, 189 insertions(+), 12 deletions(-) create mode 100644 Program.cs create mode 100644 ci.csproj delete mode 100644 main.c create mode 100644 obj/ci.csproj.nuget.dgspec.json create mode 100644 obj/ci.csproj.nuget.g.props create mode 100644 obj/ci.csproj.nuget.g.targets create mode 100644 obj/project.assets.json create mode 100644 obj/project.nuget.cache diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 787dea9..4ae9549 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -6,10 +6,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: build using gcc - run: gcc -Wall -Werror main.c -o program - - name: Archive production artifacts - uses: actions/upload-artifact@v3 + - uses: actions/setup-dotnet@v3 with: - name: program - path: program + dotnet-version: '8.0.x' + - run: dotnet restore + - run: dotnet build + test: + steps: + - name: trying to run + run: dotnet run + diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..3751555 --- /dev/null +++ b/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/ci.csproj b/ci.csproj new file mode 100644 index 0000000..2150e37 --- /dev/null +++ b/ci.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/main.c b/main.c deleted file mode 100644 index dd9f660..0000000 --- a/main.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(){ - printf("Helo, Welt!"); - return 0; -} diff --git a/obj/ci.csproj.nuget.dgspec.json b/obj/ci.csproj.nuget.dgspec.json new file mode 100644 index 0000000..23927fb --- /dev/null +++ b/obj/ci.csproj.nuget.dgspec.json @@ -0,0 +1,69 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\Artem\\Desktop\\Procesy Wytworzania Opragramowania\\ci\\ci.csproj": {} + }, + "projects": { + "C:\\Users\\Artem\\Desktop\\Procesy Wytworzania Opragramowania\\ci\\ci.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Artem\\Desktop\\Procesy Wytworzania Opragramowania\\ci\\ci.csproj", + "projectName": "ci", + "projectPath": "C:\\Users\\Artem\\Desktop\\Procesy Wytworzania Opragramowania\\ci\\ci.csproj", + "packagesPath": "C:\\Users\\Artem\\.nuget\\packages\\", + "outputPath": "C:\\Users\\Artem\\Desktop\\Procesy Wytworzania Opragramowania\\ci\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Artem\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "C:\\Program Files\\dotnet\\library-packs": {}, + "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", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.403/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/obj/ci.csproj.nuget.g.props b/obj/ci.csproj.nuget.g.props new file mode 100644 index 0000000..d74860b --- /dev/null +++ b/obj/ci.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\Artem\.nuget\packages\ + PackageReference + 6.11.1 + + + + + \ No newline at end of file diff --git a/obj/ci.csproj.nuget.g.targets b/obj/ci.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/obj/ci.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/obj/project.assets.json b/obj/project.assets.json new file mode 100644 index 0000000..eabd180 --- /dev/null +++ b/obj/project.assets.json @@ -0,0 +1,74 @@ +{ + "version": 3, + "targets": { + "net8.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net8.0": [] + }, + "packageFolders": { + "C:\\Users\\Artem\\.nuget\\packages\\": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Artem\\Desktop\\Procesy Wytworzania Opragramowania\\ci\\ci.csproj", + "projectName": "ci", + "projectPath": "C:\\Users\\Artem\\Desktop\\Procesy Wytworzania Opragramowania\\ci\\ci.csproj", + "packagesPath": "C:\\Users\\Artem\\.nuget\\packages\\", + "outputPath": "C:\\Users\\Artem\\Desktop\\Procesy Wytworzania Opragramowania\\ci\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Artem\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "C:\\Program Files\\dotnet\\library-packs": {}, + "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", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.403/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/obj/project.nuget.cache b/obj/project.nuget.cache new file mode 100644 index 0000000..844720d --- /dev/null +++ b/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "Ei4HczJ34JA=", + "success": true, + "projectFilePath": "C:\\Users\\Artem\\Desktop\\Procesy Wytworzania Opragramowania\\ci\\ci.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file