diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index c097c6b..df2a236 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -1,17 +1,49 @@ name: First CI -on: [push] +on: + push: jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3 + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0.x' - - run: dotnet restore - - run: dotnet build + + - name: Restore dependencies + run: dotnet restore + + - name: Build the project + run: dotnet build + + - name: Run tests + run: dotnet test + + - name: Publish application + run: dotnet publish -o app -r linux-x64 --sc /p:PublishSingleFile=true /p:AssemblyName=app + + - name: Create tarball + run: tar cf app.tar app/ + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: app.tar + path: app.tar + test: steps: - - name: trying to run - run: dotnet run \ No newline at end of file + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: app.tar + + - name: Extract tarball + run: tar xf app.tar + + - name: Run the application + run: ./app/app