From c76de82ff8dba1431ab8c3b63b4892f1e608a74a Mon Sep 17 00:00:00 2001 From: Ricardo Carneiro Date: Wed, 23 Jul 2025 13:33:18 -0300 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20build=20vers=C3=A3o=20de=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BCards.sln | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BCards.sln b/BCards.sln index 095b5c4..19d9fe7 100644 --- a/BCards.sln +++ b/BCards.sln @@ -13,6 +13,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{02EA scripts\test-mongodb-connection.sh = scripts\test-mongodb-connection.sh EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pipeline", "Pipeline", "{3F3DEEDF-9E0A-434D-8130-1FBAC43FD1F7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU From 0d9a4b96ae668a360cba861a087f6643d4e14f31 Mon Sep 17 00:00:00 2001 From: Ricardo Carneiro <71648276+ricarneiro@users.noreply.github.com> Date: Wed, 23 Jul 2025 14:55:43 -0300 Subject: [PATCH 2/3] fix: appSettings de teste --- BCards.sln | 3 +++ src/BCards.Web/appSettings.Testing.json | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/BCards.Web/appSettings.Testing.json diff --git a/BCards.sln b/BCards.sln index 19d9fe7..b49ff96 100644 --- a/BCards.sln +++ b/BCards.sln @@ -14,6 +14,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{02EA EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pipeline", "Pipeline", "{3F3DEEDF-9E0A-434D-8130-1FBAC43FD1F7}" + ProjectSection(SolutionItems) = preProject + .gitea\workflows\release-deploy.yml = .gitea\workflows\release-deploy.yml + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/BCards.Web/appSettings.Testing.json b/src/BCards.Web/appSettings.Testing.json new file mode 100644 index 0000000..037e03b --- /dev/null +++ b/src/BCards.Web/appSettings.Testing.json @@ -0,0 +1,20 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Microsoft.EntityFrameworkCore": "Warning" + } + }, + "ConnectionStrings": { + "DefaultConnection": "mongodb://localhost:27017/BCardsDB_Testing" + }, + "AllowedHosts": "*", + "JWT": { + "Secret": "ThisIsATestSecretKeyForJWTTokenGeneration123456789", + "Issuer": "BCards-Testing", + "Audience": "BCards-Users-Testing", + "ExpiryMinutes": 60 + }, + "Environment": "Testing" +} \ No newline at end of file From 8de7da2d9cfeb45f275910723b12240146200509 Mon Sep 17 00:00:00 2001 From: Ricardo Carneiro <71648276+ricarneiro@users.noreply.github.com> Date: Wed, 23 Jul 2025 15:19:10 -0300 Subject: [PATCH 3/3] fix: skiptestes baseado em variavel --- .gitea/workflows/release-deploy.yml | 37 +++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release-deploy.yml b/.gitea/workflows/release-deploy.yml index e5a951a..8384de7 100644 --- a/.gitea/workflows/release-deploy.yml +++ b/.gitea/workflows/release-deploy.yml @@ -9,13 +9,22 @@ env: REGISTRY: registry.redecarneir.us IMAGE_NAME: bcards MONGODB_HOST: 192.168.0.100:27017 + # Variável para controlar execução dos testes + SKIP_TESTS: ${{ vars.SKIP_TESTS || 'false' }} jobs: test: name: Run Tests runs-on: ubuntu-latest + # Só executa se SKIP_TESTS não for 'true' + if: ${{ vars.SKIP_TESTS != 'true' }} steps: + - name: Show test status + run: | + echo "🧪 SKIP_TESTS = ${{ vars.SKIP_TESTS }}" + echo "✅ Executando testes porque SKIP_TESTS != 'true'" + - name: Checkout code uses: actions/checkout@v4 @@ -38,12 +47,35 @@ jobs: echo "Testing MongoDB connection to $MONGODB_HOST" timeout 10 bash -c "