1212 - " .github/workflows/main.yml"
1313 - " .github/workflows/_deploy-container.yml"
1414 - " .github/workflows/_migrate-database.yml"
15- - " .github/workflows/_preview-migrations.yml"
1615 - " !**.md"
1716 pull_request :
1817 paths :
2322 - " .github/workflows/main.yml"
2423 - " .github/workflows/_deploy-container.yml"
2524 - " .github/workflows/_migrate-database.yml"
26- - " .github/workflows/_preview-migrations.yml"
2725 - " !**.md"
2826 workflow_dispatch :
2927
@@ -89,36 +87,19 @@ jobs:
8987 run : |
9088 # Extract UserSecretsId from the .csproj file
9189 USER_SECRETS_ID=$(grep -oP '(?<=<UserSecretsId>).*?(?=</UserSecretsId>)' SharedKernel.csproj)
92-
90+
9391 # Generate a 512-bit key and set it as a user secret that can be use for token signing when running tests
9492 dotnet user-secrets set "authentication-token-signing-key" "$(openssl rand -base64 64)" --id $USER_SECRETS_ID
9593
96- - name : Setup Java JDK for SonarScanner
97- uses : actions/setup-java@v5
98- with :
99- distribution : " microsoft"
100- java-version : " 17"
101-
10294 - name : Build Email Templates
10395 working-directory : application
10496 run : npx turbo run build --filter=@repo/emails
10597
106- - name : Run Tests with SonarScanner Analysis
98+ - name : Run Tests
10799 working-directory : application
108- env :
109- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
110- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
111100 run : |
112- if [[ "${{ vars.SONAR_PROJECT_KEY }}" == "" ]] || [[ "${{ vars.SONAR_ORGANIZATION }}" == "" ]] || [[ "${{ secrets.SONAR_TOKEN }}" == "" ]]; then
113- echo "SonarCloud is not enabled. Skipping SonarCloud analysis."
114- dotnet build main/Main.slnf --no-restore /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }} &&
115- dotnet test main/Main.slnf --no-build
116- else
117- dotnet sonarscanner begin /k:"${{ vars.SONAR_PROJECT_KEY }}" /o:"${{ vars.SONAR_ORGANIZATION }}" /d:sonar.host.url="https://sonarcloud.io" &&
118- dotnet build main/Main.slnf --no-restore /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }} &&
119- dotnet test main/Main.slnf --no-build &&
120- dotnet sonarscanner end
121- fi
101+ dotnet build main/Main.slnf --no-restore /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }} &&
102+ dotnet test main/Main.slnf --no-build
122103
123104 - name : Save Backend Build Artifacts for Migration Plan
124105 if : ${{ vars.STAGING_CLUSTER_ENABLED == 'true' }}
@@ -144,7 +125,8 @@ jobs:
144125 if : ${{ steps.determine_deployment.outputs.deploy_staging == 'true' }}
145126 working-directory : application/main
146127 run : |
147- dotnet publish ./Api/Main.Api.csproj --no-restore --configuration Release --output ./Api/publish /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }}
128+ dotnet publish ./Api/Main.Api.csproj --configuration Release --no-restore --output ./Api/publish /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }}
129+
148130 - name : Save API Artifacts
149131 if : ${{ steps.determine_deployment.outputs.deploy_staging == 'true' }}
150132 uses : actions/upload-artifact@v7
@@ -156,13 +138,15 @@ jobs:
156138 if : ${{ steps.determine_deployment.outputs.deploy_staging == 'true' }}
157139 working-directory : application/main
158140 run : |
159- dotnet publish ./Workers/Main.Workers.csproj --no-restore --configuration Release --output ./Workers/publish /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }}
141+ dotnet publish ./Workers/Main.Workers.csproj --configuration Release --no-restore --output ./Workers/publish /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }}
142+
160143 - name : Save Workers Artifacts
161144 if : ${{ steps.determine_deployment.outputs.deploy_staging == 'true' }}
162145 uses : actions/upload-artifact@v7
163146 with :
164147 name : main-workers
165148 path : application/main/Workers/publish/**/*
149+
166150 database-migrations-stage :
167151 name : Database Staging
168152 if : ${{ vars.STAGING_CLUSTER_ENABLED == 'true' }}
0 commit comments