Add CI workflow to build, publish and test .NET app with artifact
All checks were successful
First CI / build (push) Successful in 1m30s
First CI / test (push) Successful in 16s

This commit is contained in:
sofacela
2025-11-20 13:46:16 +01:00
parent cc332750f8
commit c82ec5f050

View File

@@ -1,16 +1,31 @@
name: First CI name: First CI
on: [push] on: [push]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: build using gcc - uses: actions/setup-dotnet@v3
run: |
gcc -Wall -Werror main.c -o program
ls -l program || true
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with: with:
name: program dotnet-version: '8.0.x'
path: program - run: dotnet restore
- run: dotnet build
- run: dotnet test
- run: dotnet publish -o app -r linux-x64 /p:PublishSingleFile=true,AssemblyName=app
- run: tar cf app.tar app/
- uses: actions/upload-artifact@v3
with:
name: app.tar
path: app.tar
test:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: app.tar
- run: tar xf app.tar
- run: ./app/app