Zmiana na .NET i wieloetapowe CI
Some checks failed
First CI / build (push) Successful in 1m32s
First CI / test (push) Failing after 15s

This commit is contained in:
Liliia Hurko
2025-11-21 13:50:19 +01:00
parent cb46cfef10
commit b8d958b3d7
4 changed files with 47 additions and 14 deletions

View File

@@ -8,11 +8,31 @@ jobs:
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
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
name: program
path: program
dotnet-version: '8.0.x'
- run: dotnet restore
- run: dotnet build
- run: dotnet publish -o app -r linux-x64 --sc -p:PublishSingleFile=true -p:AssemblyName=app
- run: tar cf app.tar app/
- uses: actions/upload-artifact@v3
with:
name: app.tar
path: app.tar
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: app.tar
- run: tar xf app.tar/app.tar || tar xf app.tar
- run: ./app/app

10
Program.cs Normal file
View File

@@ -0,0 +1,10 @@
// Program.cs
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, World!");
}
}

10
lab7.csproj Normal file
View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

7
main.c
View File

@@ -1,7 +0,0 @@
#include <stdio.h>
int main()
{
printf("Halo, Welt!");
return 0;
}