diff --git a/.github/workflows/.env b/.github/workflows/.env new file mode 100644 index 0000000..f507cf9 --- /dev/null +++ b/.github/workflows/.env @@ -0,0 +1,13 @@ +# Environment file for user defined variables in docker-compose.yml + +# 1. CONFIG_PATH: Path to Config.json file +# Ex: CONFIG_PATH="C:\\Config\\Config.json" +CONFIG_PATH=".\\config.json" + +# 2. ACCEPT_EULA: Pass 'Y' to accept license terms for Azure SQL Edge and Azure Service Bus emulator. +# Service Bus emulator EULA : https://github.com/Azure/azure-service-bus-emulator-installer/blob/main/EMULATOR_EULA.txt +# SQL Edge EULA : https://go.microsoft.com/fwlink/?linkid=2139274 +ACCEPT_EULA="Y" + +# 3. MSSQL_SA_PASSWORD to be filled by user as per policy : https://learn.microsoft.com/sql/relational-databases/security/strong-passwords?view=sql-server-linux-ver16 +MSSQL_SA_PASSWORD="BTMS@L0c4l" \ No newline at end of file diff --git a/.github/workflows/check-pull-request.yml b/.github/workflows/check-pull-request.yml index 168d43b..cb89a5a 100644 --- a/.github/workflows/check-pull-request.yml +++ b/.github/workflows/check-pull-request.yml @@ -28,6 +28,7 @@ jobs: mongodb-version: '7.0' mongodb-replica-set: test-rs mongodb-port: 29017 + - name: Install Docker using Docker's official script run: | curl -fsSL https://get.docker.com -o get-docker.sh @@ -41,6 +42,10 @@ jobs: docker-compose --version continue-on-error: false + - name: Start application-specific services using Docker Compose + run: docker-compose up -d + continue-on-error: false + - name: Test run: dotnet test --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory ./coverage diff --git a/.github/workflows/compose.yml b/.github/workflows/compose.yml new file mode 100644 index 0000000..68a5c1e --- /dev/null +++ b/.github/workflows/compose.yml @@ -0,0 +1,31 @@ +name: microsoft-azure-servicebus-emulator +services: + emulator: + container_name: "servicebus-emulator" + image: mcr.microsoft.com/azure-messaging/servicebus-emulator:latest + volumes: + - "${CONFIG_PATH}:/ServiceBus_Emulator/ConfigFiles/Config.json" + ports: + - "5672:5672" + environment: + SQL_SERVER: sqledge + MSSQL_SA_PASSWORD: ${MSSQL_SA_PASSWORD} + ACCEPT_EULA: ${ACCEPT_EULA} + depends_on: + - sqledge + networks: + sb-emulator: + aliases: + - "sb-emulator" + sqledge: + container_name: "sqledge" + image: "mcr.microsoft.com/azure-sql-edge:latest" + networks: + sb-emulator: + aliases: + - "sqledge" + environment: + ACCEPT_EULA: ${ACCEPT_EULA} + MSSQL_SA_PASSWORD: ${MSSQL_SA_PASSWORD} +networks: + sb-emulator: \ No newline at end of file diff --git a/.github/workflows/config.json b/.github/workflows/config.json new file mode 100644 index 0000000..839d020 --- /dev/null +++ b/.github/workflows/config.json @@ -0,0 +1,59 @@ +{ + "UserConfig": { + "Namespaces": [ + { + "Name": "sbemulatorns", + + "Topics": [ + { + "Name": "dev_alvs_topic_vnet", + "Properties": { + "DefaultMessageTimeToLive": "PT1H", + "DuplicateDetectionHistoryTimeWindow": "PT20S", + "RequiresDuplicateDetection": false + }, + "Subscriptions": [ + { + "Name": "dev_btms_sub_vnet", + "Properties": { + "DeadLetteringOnMessageExpiration": false, + "DefaultMessageTimeToLive": "PT1H", + "LockDuration": "PT1M", + "MaxDeliveryCount": 10, + "ForwardDeadLetteredMessagesTo": "", + "ForwardTo": "", + "RequiresSession": false + } + } + ] + }, + { + "Name": "dev_notification_topic_vnet", + "Properties": { + "DefaultMessageTimeToLive": "PT1H", + "DuplicateDetectionHistoryTimeWindow": "PT20S", + "RequiresDuplicateDetection": false + }, + "Subscriptions": [ + { + "Name": "dev_btms_sub_vnet", + "Properties": { + "DeadLetteringOnMessageExpiration": false, + "DefaultMessageTimeToLive": "PT1H", + "LockDuration": "PT1M", + "MaxDeliveryCount": 10, + "ForwardDeadLetteredMessagesTo": "", + "ForwardTo": "", + "RequiresSession": false + } + } + ] + } + ] + } + ], + "Logging": { + "Type": "File" + } + } +}