From 3d84f3f852c098bfe326118b11641315e680d551 Mon Sep 17 00:00:00 2001 From: reduan-azouaghe Date: Tue, 16 Sep 2025 08:03:45 +0200 Subject: [PATCH 1/8] Create sync.yml --- .github/workflows/sync.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000..afb973f --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,16 @@ +name: sync-fork +on: + schedule: + - cron: '0 * * * *' + workflow_dispatch: { } +jobs: + sync: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - run: gh repo sync $REPOSITORY -b $BRANCH_NAME + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPOSITORY: ${{ github.repository }} + BRANCH_NAME: ${{ github.ref_name }} From 46d09d7e347bab3e5f40f5a812d6ea8bbff1718a Mon Sep 17 00:00:00 2001 From: reduan-azouaghe Date: Tue, 16 Sep 2025 08:07:04 +0200 Subject: [PATCH 2/8] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_team-3-back-end.yml | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/main_team-3-back-end.yml diff --git a/.github/workflows/main_team-3-back-end.yml b/.github/workflows/main_team-3-back-end.yml new file mode 100644 index 0000000..98eb9c6 --- /dev/null +++ b/.github/workflows/main_team-3-back-end.yml @@ -0,0 +1,55 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy ASP.Net Core app to Azure Web App - team-3-back-end + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + permissions: + contents: read #This is required for actions/checkout + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.x' + + - name: Build with dotnet + run: dotnet build --configuration Release + + - name: dotnet publish + run: dotnet publish -c Release -o "${{env.DOTNET_ROOT}}/myapp" + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: .net-app + path: ${{env.DOTNET_ROOT}}/myapp + + deploy: + runs-on: windows-latest + needs: build + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: .net-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'team-3-back-end' + slot-name: 'Production' + package: . + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_C74F2CEAD30D41B7A547A5CB4E5D5890 }} \ No newline at end of file From 1aa3258d7dd4a103a3883fa9e99b36e52516c4c9 Mon Sep 17 00:00:00 2001 From: reduan-azouaghe Date: Wed, 17 Sep 2025 11:08:52 +0200 Subject: [PATCH 3/8] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_team-3-back-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_team-3-back-end.yml b/.github/workflows/main_team-3-back-end.yml index 98eb9c6..471a653 100644 --- a/.github/workflows/main_team-3-back-end.yml +++ b/.github/workflows/main_team-3-back-end.yml @@ -52,4 +52,4 @@ jobs: app-name: 'team-3-back-end' slot-name: 'Production' package: . - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_C74F2CEAD30D41B7A547A5CB4E5D5890 }} \ No newline at end of file + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_EA0A96C14F27496EACC0749F1601D78B }} \ No newline at end of file From a0a72196148c305d9afff279885ce45dedad8d7d Mon Sep 17 00:00:00 2001 From: reduan-azouaghe Date: Thu, 18 Sep 2025 08:39:32 +0200 Subject: [PATCH 4/8] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_team-3-back-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_team-3-back-end.yml b/.github/workflows/main_team-3-back-end.yml index 471a653..af6c406 100644 --- a/.github/workflows/main_team-3-back-end.yml +++ b/.github/workflows/main_team-3-back-end.yml @@ -52,4 +52,4 @@ jobs: app-name: 'team-3-back-end' slot-name: 'Production' package: . - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_EA0A96C14F27496EACC0749F1601D78B }} \ No newline at end of file + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_83F536AB3730476582C40FF3CCECAD36 }} \ No newline at end of file From 71e496e9601bc80641fd3eb4e7677d5136a21c9a Mon Sep 17 00:00:00 2001 From: reduan-azouaghe Date: Wed, 24 Sep 2025 09:14:10 +0200 Subject: [PATCH 5/8] Update testDotnetPostgres.yml --- .github/workflows/testDotnetPostgres.yml | 25 ++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testDotnetPostgres.yml b/.github/workflows/testDotnetPostgres.yml index 550f5a3..641c9dc 100644 --- a/.github/workflows/testDotnetPostgres.yml +++ b/.github/workflows/testDotnetPostgres.yml @@ -5,6 +5,7 @@ on: branches: [ main ] pull_request: branches: [ main ] + workflow_dispatch: jobs: build-and-test: @@ -79,5 +80,25 @@ jobs: --configuration $CONFIGURATION \ --connection "$ConnectionStrings__LocalDatabase" - - name: Run tests - run: dotnet test -c $CONFIGURATION + - name: Test + run: dotnet test src/Example.sln --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage + + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: coverage/**/coverage.cobertura.xml + badge: true + fail_below_min: true + format: markdown + hide_branch_rate: false + hide_complexity: true + indicators: true + output: both + thresholds: '60 80' + + - name: Add Coverage PR Comment + uses: marocchino/sticky-pull-request-comment@v2 + if: github.event_name == 'pull_request' + with: + recreate: true + path: code-coverage-results.md From 7e52dacb2726c820e601d8255996efe9778ebf10 Mon Sep 17 00:00:00 2001 From: reduan-azouaghe Date: Wed, 24 Sep 2025 09:18:55 +0200 Subject: [PATCH 6/8] Update testDotnetPostgres.yml --- .github/workflows/testDotnetPostgres.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testDotnetPostgres.yml b/.github/workflows/testDotnetPostgres.yml index 641c9dc..a8c31fd 100644 --- a/.github/workflows/testDotnetPostgres.yml +++ b/.github/workflows/testDotnetPostgres.yml @@ -81,7 +81,7 @@ jobs: --connection "$ConnectionStrings__LocalDatabase" - name: Test - run: dotnet test src/Example.sln --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage + run: dotnet test ./exercise.sln --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 From e64227ed1475699b80b81671686f95e31fbf75da Mon Sep 17 00:00:00 2001 From: reduan-azouaghe Date: Wed, 24 Sep 2025 09:23:59 +0200 Subject: [PATCH 7/8] Update testDotnetPostgres.yml --- .github/workflows/testDotnetPostgres.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testDotnetPostgres.yml b/.github/workflows/testDotnetPostgres.yml index a8c31fd..577c8f8 100644 --- a/.github/workflows/testDotnetPostgres.yml +++ b/.github/workflows/testDotnetPostgres.yml @@ -81,7 +81,7 @@ jobs: --connection "$ConnectionStrings__LocalDatabase" - name: Test - run: dotnet test ./exercise.sln --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage + run: dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 From e2aa786654688acf2f03f0d5c884b86e73b26c88 Mon Sep 17 00:00:00 2001 From: reduan-azouaghe Date: Wed, 24 Sep 2025 09:26:34 +0200 Subject: [PATCH 8/8] Update testDotnetPostgres.yml --- .github/workflows/testDotnetPostgres.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testDotnetPostgres.yml b/.github/workflows/testDotnetPostgres.yml index 577c8f8..3416dc1 100644 --- a/.github/workflows/testDotnetPostgres.yml +++ b/.github/workflows/testDotnetPostgres.yml @@ -81,7 +81,7 @@ jobs: --connection "$ConnectionStrings__LocalDatabase" - name: Test - run: dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage + run: dotnet test -c $CONFIGURATION --collect:"XPlat Code Coverage" --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0