From 3b8e494ac6b309a1ddf980c055989b5293625f6e Mon Sep 17 00:00:00 2001 From: TZ Date: Sat, 6 Dec 2025 12:20:31 +0100 Subject: [PATCH 1/5] Trigger CI workflow --- lab5/sample-ci/README.md | Bin 2373 -> 2641 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/lab5/sample-ci/README.md b/lab5/sample-ci/README.md index 024de0592d213b50b70f1f3054bb054b12de1e07..c3480b5f324504f75541226f1c8963dfdc43ed7d 100644 GIT binary patch delta 1025 zcmb_a&ubGw6rOF;B(98tR0}HdFcm^-no^s#r~zxT)@p16P4%FKY_e;+`7yKX&RW`w z28E&sHNf7R@YoNnPXBt2NO$14d!5_d|lm^xMfeYe3+WVWcg|cF6_~6nEnRUn-=V` zr@F-jvjup_m3vsbe-Bunhx|S?bFtra^(P`A5VZ4pbH7*!`J;zij}=mbYA<7BbHB6c z&xGpC?SjL6VRkyv1&^K>fWO90-~2mRaq6cl1?Q`aU@*(&4imnD=AgcSv&z>Yhw_>t z@Kp|#&A1ZdS$q=XyZG6IVP@H=7&Sw_h>y;$`oZo)WdjQx5sd>%i}_L+s*Y=S95xVU zemn4NDBJgzU7yM;!}-H1J)1Rz>296RW~qEIjFyo*!^UV-C=CmaxEeHIz9}5e5Op#! z9l9l(y~Z1U2)doPgrMh%lJcnhoH#ZRMH!86q804$xt-87kx|g9ksfI%bIWWE9w5h) z%CT$748}*vOvD5#4i3DZgxXU1Hkla-S;DUqkl&Ki`>LKxWkOnaQnOf3hVgx>i09;i u;(hco0a76*Y2aSKmBUpcix`)QO9XL97uPmss52*wP@ delta 714 zcmZ`%O=uHA6lR-jHkm47srX+8gcm>Cdlkg#C0W%h6 z5qjVYE;SSmj656~h37K`D9)6gME}t}>Y__}oZ`?A+dHDqC}&hRPvh-DpFAX-5wwIe z>$Q9M2Hvc$sbpQaG}8%i?%Ei*^%oUSv|(FQ79+ha66~P1J1rqs$g`YE?9)IBpXxkH zLmsJug;>!*upPTN|1Uc1#|q{c_&Ii2Nl+V^c9@QfxYx&w2a@!9QLG|gj!BF0OZESg zq|y}O^lr+HRb1n)Cm5FjQj<4V)Ecr)yrirlG7K~VUdQw5oq)QTf}im@u*|EFH#1`k zE34T`6*rhidyG#OTiy+QimUX|h8MsyGkXLf$Eiu;4Q@IP9Gc5;G*MHtYZF$OydAc1 zxht9dt)ei95jI=>4FroP#y%-045lrg2rc zq@&NtRhI>ORu0}-Hhi;e-4EB9TGX`q>Fr~3R0+IP$w0pW@yOdE From ee02eff3f1ab4a0d21d11e6a754168a5e68a42a6 Mon Sep 17 00:00:00 2001 From: TZ Date: Sat, 6 Dec 2025 12:21:57 +0100 Subject: [PATCH 2/5] Trigger CI workflow --- lab5/sample-ci/README.md | Bin 2641 -> 2695 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/lab5/sample-ci/README.md b/lab5/sample-ci/README.md index c3480b5f324504f75541226f1c8963dfdc43ed7d..1cf149696e75b7b6d3120242737610112e41af35 100644 GIT binary patch delta 11 Scmca8(k{9okZZCuml*&V1Os~j delta 7 OcmZn{y(qFFkP83{R|1Uy From f253c85b1a1ab14e21613dced693745218185919 Mon Sep 17 00:00:00 2001 From: TZ Date: Sat, 6 Dec 2025 12:28:47 +0100 Subject: [PATCH 3/5] Add optimized CI workflow --- .github/workflows/ci-optimized.yml | 62 ++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/ci-optimized.yml diff --git a/.github/workflows/ci-optimized.yml b/.github/workflows/ci-optimized.yml new file mode 100644 index 0000000..68a9727 --- /dev/null +++ b/.github/workflows/ci-optimized.yml @@ -0,0 +1,62 @@ +name: CI - Optimized + +on: + push: + branches: [ "main" ] + pull_request: + +jobs: + backend: + name: Backend (.NET) + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('lab5/sample-ci/backend/**/*.csproj') }} + + - name: Restore + run: dotnet restore lab5/sample-ci/backend + + - name: Build + run: dotnet build lab5/sample-ci/backend --no-restore --configuration Release + + - name: Test + run: dotnet test lab5/sample-ci/backend --no-build --configuration Release --logger trx + + - name: Publish + run: dotnet publish lab5/sample-ci/backend --no-build --configuration Release --output ./publish + + frontend: + name: Frontend (Node.js) + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + cache-dependency-path: lab5/sample-ci/frontend/package-lock.json + + - name: Install + run: npm ci --prefix lab5/sample-ci/frontend + + - name: Test + run: npm test --prefix lab5/sample-ci/frontend + + - name: Build + run: npm run build --prefix lab5/sample-ci/frontend From 40beed2353b30c0cbbb7213a00b8544c89af79d4 Mon Sep 17 00:00:00 2001 From: TZ Date: Sat, 6 Dec 2025 12:30:43 +0100 Subject: [PATCH 4/5] Add optimized CI workflow --- .github/workflows/ci-optimized.yml | 53 +++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-optimized.yml b/.github/workflows/ci-optimized.yml index 68a9727..c865e4b 100644 --- a/.github/workflows/ci-optimized.yml +++ b/.github/workflows/ci-optimized.yml @@ -2,10 +2,11 @@ name: CI - Optimized on: push: - branches: [ "main" ] + branches: [ main ] pull_request: jobs: + backend: name: Backend (.NET) runs-on: ubuntu-latest @@ -26,16 +27,34 @@ jobs: key: ${{ runner.os }}-nuget-${{ hashFiles('lab5/sample-ci/backend/**/*.csproj') }} - name: Restore - run: dotnet restore lab5/sample-ci/backend + run: | + cd lab5/sample-ci/backend/ProductApi + dotnet restore + cd ../ProductApi.Tests + dotnet restore - name: Build - run: dotnet build lab5/sample-ci/backend --no-restore --configuration Release + run: | + cd lab5/sample-ci/backend/ProductApi + dotnet build --no-restore --configuration Release + cd ../ProductApi.Tests + dotnet build --no-restore --configuration Release - name: Test - run: dotnet test lab5/sample-ci/backend --no-build --configuration Release --logger trx + run: | + cd lab5/sample-ci/backend/ProductApi.Tests + dotnet test --no-build --configuration Release --logger trx - name: Publish - run: dotnet publish lab5/sample-ci/backend --no-build --configuration Release --output ./publish + run: | + cd lab5/sample-ci/backend/ProductApi + dotnet publish --no-build --configuration Release --output ./publish + + - name: Upload backend artifact + uses: actions/upload-artifact@v4 + with: + name: backend + path: lab5/sample-ci/backend/ProductApi/publish frontend: name: Frontend (Node.js) @@ -48,15 +67,27 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20 + node-version: '20' cache: 'npm' cache-dependency-path: lab5/sample-ci/frontend/package-lock.json - - name: Install - run: npm ci --prefix lab5/sample-ci/frontend + - name: Install dependencies + run: | + cd lab5/sample-ci/frontend + npm ci - - name: Test - run: npm test --prefix lab5/sample-ci/frontend + - name: Run tests + run: | + cd lab5/sample-ci/frontend + npm test - name: Build - run: npm run build --prefix lab5/sample-ci/frontend + run: | + cd lab5/sample-ci/frontend + npm run build + + - name: Upload frontend artifact + uses: actions/upload-artifact@v4 + with: + name: frontend + path: lab5/sample-ci/frontend/dist From edd6472743f2217fa27eee8fd0262e77b07a54ed Mon Sep 17 00:00:00 2001 From: TZ Date: Sat, 6 Dec 2025 12:38:12 +0100 Subject: [PATCH 5/5] Add footer with CI/CD info --- lab5/sample-ci/frontend/index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lab5/sample-ci/frontend/index.html b/lab5/sample-ci/frontend/index.html index ece0929..4cc6904 100644 --- a/lab5/sample-ci/frontend/index.html +++ b/lab5/sample-ci/frontend/index.html @@ -53,5 +53,9 @@

Product Manager

+ +