From f5b68b91834ccd4bcab33416cd2d66227eae68fb Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 11 Mar 2024 11:13:31 -0700 Subject: [PATCH 001/149] Initial separation of pipeline for onboarding to github actions for build process. --- .../workflows/fhir-oss-build-variables.yml | 36 +++ .github/workflows/fhir-oss-ci-pipeline.yml | 285 ++++++++++++++++++ .../fhir-oss-ci-test-enviroment-variables.yml | 10 + .github/workflows/jobs/analyze.yml | 201 ++++++++++++ .github/workflows/jobs/build.yml | 88 ++++++ .../workflows/jobs/clean-storage-accounts.yml | 31 ++ .github/workflows/jobs/docker-add-tag.yml | 28 ++ .github/workflows/jobs/docker-build-all.yml | 27 ++ .github/workflows/jobs/docker-build-push.yml | 40 +++ .github/workflows/jobs/e2e-setup.yml | 23 ++ .github/workflows/jobs/e2e-tests-extract.yml | 10 + .github/workflows/jobs/e2e-tests.yml | 139 +++++++++ .../jobs/package-integration-tests.yml | 17 ++ .github/workflows/jobs/package-web.yml | 14 + .github/workflows/jobs/package.yml | 93 ++++++ .../workflows/jobs/provision-healthcheck.yml | 26 ++ .../workflows/jobs/provision-sqlServer.yml | 44 +++ .github/workflows/jobs/redeploy-webapp.yml | 29 ++ .github/workflows/jobs/run-tests.yml | 79 +++++ .github/workflows/jobs/update-semver.yml | 31 ++ .../jobs/update-sqlAdminPassword.yml | 18 ++ 21 files changed, 1269 insertions(+) create mode 100644 .github/workflows/fhir-oss-build-variables.yml create mode 100644 .github/workflows/fhir-oss-ci-pipeline.yml create mode 100644 .github/workflows/fhir-oss-ci-test-enviroment-variables.yml create mode 100644 .github/workflows/jobs/analyze.yml create mode 100644 .github/workflows/jobs/build.yml create mode 100644 .github/workflows/jobs/clean-storage-accounts.yml create mode 100644 .github/workflows/jobs/docker-add-tag.yml create mode 100644 .github/workflows/jobs/docker-build-all.yml create mode 100644 .github/workflows/jobs/docker-build-push.yml create mode 100644 .github/workflows/jobs/e2e-setup.yml create mode 100644 .github/workflows/jobs/e2e-tests-extract.yml create mode 100644 .github/workflows/jobs/e2e-tests.yml create mode 100644 .github/workflows/jobs/package-integration-tests.yml create mode 100644 .github/workflows/jobs/package-web.yml create mode 100644 .github/workflows/jobs/package.yml create mode 100644 .github/workflows/jobs/provision-healthcheck.yml create mode 100644 .github/workflows/jobs/provision-sqlServer.yml create mode 100644 .github/workflows/jobs/redeploy-webapp.yml create mode 100644 .github/workflows/jobs/run-tests.yml create mode 100644 .github/workflows/jobs/update-semver.yml create mode 100644 .github/workflows/jobs/update-sqlAdminPassword.yml diff --git a/.github/workflows/fhir-oss-build-variables.yml b/.github/workflows/fhir-oss-build-variables.yml new file mode 100644 index 0000000000..7f28b89720 --- /dev/null +++ b/.github/workflows/fhir-oss-build-variables.yml @@ -0,0 +1,36 @@ +# DESCRIPTION: +# Variables used during builds. + +variables: + buildConfiguration: 'Release' + defaultBuildFramework: 'net8.0' + azureSubscriptionEndpoint: 'docker-build' + azureContainerRegistryName: 'healthplatformregistry' + azureContainerRegistry: '$(azureContainerRegistryName).azurecr.io' + composeLocation: 'build/docker/docker-compose.yaml' + DeploymentEnvironmentNameSql: '$(DeploymentEnvironmentName)-sql' + DeploymentEnvironmentNameR4: '$(DeploymentEnvironmentName)-r4' + DeploymentEnvironmentNameR4Sql: '$(DeploymentEnvironmentNameR4)-sql' + DeploymentEnvironmentNameR4B: '$(DeploymentEnvironmentName)-r4b' + DeploymentEnvironmentNameR4BSql: '$(DeploymentEnvironmentNameR4B)-sql' + DeploymentEnvironmentNameR5: '$(DeploymentEnvironmentName)-r5' + DeploymentEnvironmentNameR5Sql: '$(DeploymentEnvironmentNameR5)-sql' + TestEnvironmentUrl: 'https://$(DeploymentEnvironmentName).azurewebsites.net' + # These variables are not used in the deployment scripts, but are used in the E2E tests files. + TestEnvironmentUrl_Sql: 'https://$(DeploymentEnvironmentName)-sql.azurewebsites.net' + TestEnvironmentUrl_R4: 'https://$(DeploymentEnvironmentName)-r4.azurewebsites.net' + TestEnvironmentUrl_R4_Sql: 'https://$(DeploymentEnvironmentName)-r4-sql.azurewebsites.net' + TestEnvironmentUrl_R4B: 'https://$(DeploymentEnvironmentName)-r4b.azurewebsites.net' + TestEnvironmentUrl_R4B_Sql: 'https://$(DeploymentEnvironmentName)-r4b-sql.azurewebsites.net' + TestEnvironmentUrl_R5: 'https://$(DeploymentEnvironmentName)-r5.azurewebsites.net' + TestEnvironmentUrl_R5_Sql: 'https://$(DeploymentEnvironmentName)-r5-sql.azurewebsites.net' + #----------------------------------------------------------------------------------------- + TestClientUrl: 'https://$(DeploymentEnvironmentName)-client/' + ConnectedServiceName: 'Microsoft Health Open Source Subscription' + WindowsVmImage: 'windows-latest' + LinuxVmImage: 'ubuntu-latest' + TestApplicationResource: 'https://$(DeploymentEnvironmentName).$(tenantDomain)' + # The following is set by a build Pipeline variable: + # DefaultLinuxPool: 'Azure Pipelines' + # SharedLinuxPool: 'Azure Pipelines' + #----------------------------------------------------------------------------------------- diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml new file mode 100644 index 0000000000..809e00b28f --- /dev/null +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -0,0 +1,285 @@ +# DESCRIPTION: +# Builds, tests, and packages the solution for the main branch. + +name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:-r) +trigger: none + +variables: +- template: fhir-oss-ci-test-environment-variables.yml +- template: fhir-oss-build-variables.yml + +stages: +# *********************** Setup *********************** +- stage: UpdateVersion + displayName: 'Determine Semver' + dependsOn: [] + jobs: + - job: Semver + pool: + name: '$(DefaultLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - template: ./jobs/update-semver.yml + +- stage: cleanStorageAccounts + displayName: 'Clean Storage Accounts' + dependsOn: [] + jobs: + - template: ./jobs/clean-storage-accounts.yml + parameters: + environmentName: $(DeploymentEnvironmentName) + +- stage: cleanupIntegrationTestDatabases + displayName: 'Cleanup Integration Test DBs' + dependsOn: [] + jobs: + - job: cleanup + pool: + name: '$(SharedLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - task: AzurePowerShell@5 + displayName: 'Azure PowerShell script: InlineScript' + inputs: + azureSubscription: $(ConnectedServiceName) + azurePowerShellVersion: latestVersion + ScriptType: inlineScript + Inline: | + $testNamePatterns = @("SNAPSHOT*","FHIRCOMPATIBILITYTEST*","FHIRINTEGRATIONTEST*","FHIRRESOURCECHANGEDISABLEDTEST*","BASE*","SNAPSHOT*") + foreach ($pattern in $testNamePatterns) { + $resources = Get-AzResource -ResourceGroupName $(ResourceGroupName) -ResourceType 'Microsoft.Sql/servers/databases' -Name $pattern + foreach ($resource in $resources) { + Write-Host "Cleaning up $($resource.ResourceName)" + Remove-AzResource -ResourceId $resource.ResourceId -Force + } + } + +- stage: BuildUnitTests + displayName: 'Build and run unit tests' + dependsOn: + - UpdateVersion + variables: + assemblySemVer: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.assemblySemVer']] + assemblySemFileVer: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.assemblySemFileVer']] + informationalVersion: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.informationalVersion']] + majorMinorPatch: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.majorMinorPatch']] + nuGetVersion: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.nuGetVersion']] + jobs: + - job: Windows_dotnet8 + pool: + name: '$(DefaultWindowsPool)' + steps: + - template: ./jobs/build.yml + parameters: + targetBuildFramework: $(defaultBuildFramework) + unitTest: false + codeCoverage: true + - job: Linux_dotnet6 + pool: + name: '$(DefaultLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - template: ./jobs/build.yml + parameters: + targetBuildFramework: 'net6.0' + - job: Linux_BuildAndPackage + pool: + name: '$(DefaultLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - template: ./jobs/build.yml + parameters: + codeCoverage: false + unitTest: false + componentGovernance: true + packageArtifacts: true + packageIntegrationTests: true + +- stage: AnalyzeSecurity + displayName: 'Run Security Analysis and Validate' + dependsOn: + - BuildUnitTests + jobs: + - job: Guardian + pool: + name: '$(DefaultWindowsPool)' + + steps: + - template: ./jobs/analyze.yml + +- stage: DockerBuild + displayName: 'Build images' + dependsOn: + - UpdateVersion + variables: + assemblySemFileVer: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.assemblySemFileVer']] + jobs: + - template: ./jobs/docker-build-all.yml + parameters: + tag: $(ImageTag) + +# *********************** Stu3 *********************** +- stage: redeployStu3 + displayName: 'Redeploy STU3 CosmosDB Site' + dependsOn: + - DockerBuild + jobs: + - template: ./jobs/redeploy-webapp.yml + parameters: + version: Stu3 + webAppName: $(DeploymentEnvironmentName) + subscription: $(ConnectedServiceName) + imageTag: $(ImageTag) + +- stage: redeployStu3Sql + displayName: 'Redeploy STU3 SQL Site' + dependsOn: + - DockerBuild + jobs: + - template: ./jobs/redeploy-webapp.yml + parameters: + version: Stu3 + webAppName: $(DeploymentEnvironmentNameSql) + subscription: $(ConnectedServiceName) + imageTag: $(ImageTag) + +- stage: testStu3 + displayName: 'Run Stu3 Tests' + dependsOn: + - BuildUnitTests + - redeployStu3 + - redeployStu3Sql + jobs: + - template: ./jobs/run-tests.yml + parameters: + version: Stu3 + keyVaultName: $(DeploymentEnvironmentName) + appServiceName: $(DeploymentEnvironmentName) + +# *********************** R4 *********************** +- stage: redeployR4 + displayName: 'Redeploy R4 CosmosDB Site' + dependsOn: + - DockerBuild + jobs: + - template: ./jobs/redeploy-webapp.yml + parameters: + version: R4 + webAppName: $(DeploymentEnvironmentNameR4) + subscription: $(ConnectedServiceName) + imageTag: $(ImageTag) + +- stage: redeployR4Sql + displayName: 'Redeploy R4 SQL Site' + dependsOn: + - DockerBuild + jobs: + - template: ./jobs/redeploy-webapp.yml + parameters: + version: R4 + webAppName: $(DeploymentEnvironmentNameR4Sql) + subscription: $(ConnectedServiceName) + imageTag: $(ImageTag) + +- stage: testR4 + displayName: 'Run R4 Tests' + dependsOn: + - BuildUnitTests + - redeployR4 + - redeployR4Sql + jobs: + - template: ./jobs/run-tests.yml + parameters: + version: R4 + keyVaultName: $(DeploymentEnvironmentNameR4) + appServiceName: $(DeploymentEnvironmentNameR4) + +# *********************** R4B *********************** +- stage: redeployR4B + displayName: 'Redeploy R4B CosmosDB Site' + dependsOn: + - DockerBuild + jobs: + - template: ./jobs/redeploy-webapp.yml + parameters: + version: R4B + webAppName: $(DeploymentEnvironmentNameR4B) + subscription: $(ConnectedServiceName) + imageTag: $(ImageTag) + +- stage: redeployR4BSql + displayName: 'Redeploy R4B SQL Site' + dependsOn: + - DockerBuild + jobs: + - template: ./jobs/redeploy-webapp.yml + parameters: + version: R4B + webAppName: $(DeploymentEnvironmentNameR4BSql) + subscription: $(ConnectedServiceName) + imageTag: $(ImageTag) + +- stage: testR4B + displayName: 'Run R4B Tests' + dependsOn: + - BuildUnitTests + - redeployR4B + - redeployR4BSql + jobs: + - template: ./jobs/run-tests.yml + parameters: + version: R4B + keyVaultName: $(DeploymentEnvironmentNameR4B) + appServiceName: $(DeploymentEnvironmentNameR4B) + +# *********************** R5 *********************** +- stage: redeployR5 + displayName: 'Redeploy R5 CosmosDB Site' + dependsOn: + - DockerBuild + jobs: + - template: ./jobs/redeploy-webapp.yml + parameters: + version: R5 + webAppName: $(DeploymentEnvironmentNameR5) + subscription: $(ConnectedServiceName) + imageTag: $(ImageTag) + +- stage: redeployR5Sql + displayName: 'Redeploy R5 SQL Site' + dependsOn: + - DockerBuild + jobs: + - template: ./jobs/redeploy-webapp.yml + parameters: + version: R5 + webAppName: $(DeploymentEnvironmentNameR5Sql) + subscription: $(ConnectedServiceName) + imageTag: $(ImageTag) + +- stage: testR5 + displayName: 'Run R5 Tests' + dependsOn: + - BuildUnitTests + - redeployR5 + - redeployR5Sql + jobs: + - template: ./jobs/run-tests.yml + parameters: + version: R5 + keyVaultName: $(DeploymentEnvironmentNameR5) + appServiceName: $(DeploymentEnvironmentNameR5) + +# *********************** Finalize *********************** +- stage: DockerAddTag + displayName: 'Docker add main tag' + dependsOn: + - testStu3 + - testR4 + - testR4B + - testR5 + jobs: + - template: ./jobs/docker-add-tag.yml + parameters: + sourceTag: $(ImageTag) + targetTag: 'master' diff --git a/.github/workflows/fhir-oss-ci-test-enviroment-variables.yml b/.github/workflows/fhir-oss-ci-test-enviroment-variables.yml new file mode 100644 index 0000000000..6afcea9248 --- /dev/null +++ b/.github/workflows/fhir-oss-ci-test-enviroment-variables.yml @@ -0,0 +1,10 @@ +variables: + ResourceGroupRegion: 'southcentralus' + # Due to deleting a keyvault with purge protection we must use a name other than msh-fhir-ci for 90 days after 5/20/2021. + resourceGroupRoot: 'msh-fhir-ci4' + appServicePlanName: '$(resourceGroupRoot)-linux' + DeploymentEnvironmentName: '$(resourceGroupRoot)' + ResourceGroupName: '$(resourceGroupRoot)' + CrucibleEnvironmentUrl: 'https://crucible.mshapis.com/' + TestEnvironmentName: 'OSS CI' + ImageTag: '$(build.BuildNumber)' diff --git a/.github/workflows/jobs/analyze.yml b/.github/workflows/jobs/analyze.yml new file mode 100644 index 0000000000..5ad0110a60 --- /dev/null +++ b/.github/workflows/jobs/analyze.yml @@ -0,0 +1,201 @@ +parameters: + analyzeARMTemplates: true + analyzeBinaries: true + analyzePackages: true + runAntiMalware: true + credScanDirectory: '$(Build.SourcesDirectory)' + +steps: +- task: UseDotNet@2 + displayName: Use .NET Core sdk + inputs: + useGlobalJson: true + +- ${{ if eq(parameters.analyzeBinaries, 'true') }}: + - task: DownloadBuildArtifacts@0 + displayName: 'Download Binaries' + inputs: + buildType: 'current' + downloadType: 'single' + downloadPath: '$(Agent.TempDirectory)/artifacts' + artifactName: 'deploy' + +- ${{ if eq(parameters.analyzePackages, 'true') }}: + - task: DownloadBuildArtifacts@0 + displayName: 'Download NuGet Packages' + inputs: + buildType: 'current' + downloadType: 'single' + downloadPath: '$(Build.SourcesDirectory)/artifacts' + artifactName: 'nuget' + +- ${{ if eq(parameters.analyzeBinaries, 'true') }}: + - task: ExtractFiles@1 + displayName: 'Extract Stu3 Web Server Binaries' + inputs: + archiveFilePatterns: '$(Agent.TempDirectory)/artifacts/deploy/Microsoft.Health.Fhir.Stu3.Web.zip' + destinationFolder: '$(Build.SourcesDirectory)/artifacts/web/Stu3' + - task: ExtractFiles@1 + displayName: 'Extract R4 Web Server Binaries' + inputs: + archiveFilePatterns: '$(Agent.TempDirectory)/artifacts/deploy/Microsoft.Health.Fhir.R4.Web.zip' + destinationFolder: '$(Build.SourcesDirectory)/artifacts/web/r4' + - task: ExtractFiles@1 + displayName: 'Extract R4B Web Server Binaries' + inputs: + archiveFilePatterns: '$(Agent.TempDirectory)/artifacts/deploy/Microsoft.Health.Fhir.R4B.Web.zip' + destinationFolder: '$(Build.SourcesDirectory)/artifacts/web/r4b' + - task: ExtractFiles@1 + displayName: 'Extract R5 Web Server Binaries' + inputs: + archiveFilePatterns: '$(Agent.TempDirectory)/artifacts/deploy/Microsoft.Health.Fhir.R5.Web.zip' + destinationFolder: '$(Build.SourcesDirectory)/artifacts/web/r5' + +- ${{ if eq(parameters.runAntiMalware, 'true') }}: + - task: AntiMalware@4 + inputs: + InputType: 'Basic' + ScanType: 'CustomScan' + FileDirPath: '$(Build.SourcesDirectory)' + EnableServices: true + TreatSignatureUpdateFailureAs: 'Standard' + SignatureFreshness: 'OneDay' + TreatStaleSignatureAs: 'Error' + +- ${{ if eq(parameters.analyzeARMTemplates, 'true') }}: + - task: Armory@2 + inputs: + targetDirectory: '$(Build.SourcesDirectory)/samples/templates' + targetFiles: 'f|*.json' + excludePassesFromLog: false + + - task: TemplateAnalyzer@3 + displayName: 'Run Template Analyzer' + inputs: + ToolVersion: Latest + AnalyzeDirectory: '$(Build.SourcesDirectory)/samples/templates' + Verbose: false + IncludeNonSecurityRules: true + +- task: CredScan@3 + inputs: + scanFolder: ${{ parameters.credScanDirectory }} + outputFormat: 'pre' + suppressionsFile: 'CredScanSuppressions.json' + verboseOutput: true + +- task: CSRF@1 + inputs: + Path: '$(Build.SourcesDirectory)' + ToolVersion: Latest + +- task: Trivy@1 + displayName: 'Run Trivy' + inputs: + Target: '$(Build.SourcesDirectory)/build/docker' + Severities: all + VulTypes: all + +- task: PSScriptAnalyzer@1 + displayName: 'Run PSScriptAnalyzer' + inputs: + Path: '$(Build.SourcesDirectory)' + Settings: required + IgnorePattern: .gdn + Recurse: true + +- task: RoslynAnalyzers@3 + inputs: + userProvideBuildInfo: 'msBuildInfo' + msBuildArchitecture: 'DotNetCore' + msBuildCommandline: 'dotnet build $(Build.SourcesDirectory)/Microsoft.Health.Fhir.sln --configuration $(buildConfiguration) -p:ContinuousIntegrationBuild=true -f net8.0' + +- task: BinSkim@4 + inputs: + toolVersion: Latest + InputType: Basic + Function: analyze + AnalyzeTargetGlob: 'f|$(Agent.TempDirectory)/artifacts/**/*Microsoft.Health.*.dll' + + ## PoliCheck@2 does not need to be added since it is run internally + + ## Tools that are no longer supported: + # AutoApplicability@1, CodeMetrics@1, VulnerabilityAssessment@0 + +- task: SdtReport@2 + condition: succeededOrFailed() + continueOnError: True + inputs: + GdnExportAllTools: false + GdnExportGdnToolArmory: ${{ eq(parameters.analyzeARMTemplates, 'true') }} + GdnExportGdnToolCredScan: true + GdnExportGdnToolCSRF: true + GdnExportGdnToolRoslynAnalyzers: true + BinSkim: true + CredScan: true + +- task: PublishSecurityAnalysisLogs@3 + condition: succeededOrFailed() + continueOnError: True + inputs: + ArtifactName: 'CodeAnalysisLogs' + ArtifactType: 'Container' + AllTools: false + AntiMalware: ${{ eq(parameters.runAntiMalware, 'true') }} + APIScan: false + Armory: ${{ eq(parameters.analyzeARMTemplates, 'true') }} + Bandit: false + BinSkim: false + CodesignValidation: false + CredScan: true + CSRF: true + ESLint: false + Flawfinder: false + FortifySCA: false + FxCop: false + ModernCop: false + MSRD: false + PoliCheck: false + RoslynAnalyzers: true + SDLNativeRules: false + Semmle: false + SpotBugs: false + TSLint: false + WebScout: false + ToolLogsNotFoundAction: 'Standard' + +- task: PostAnalysis@2 + condition: succeededOrFailed() + inputs: + GdnBreakAllTools: false + GdnBreakGdnToolArmory: ${{ eq(parameters.analyzeARMTemplates, 'true') }} + GdnBreakGdnToolCredScan: true + GdnBreakGdnToolCSRF: true + GdnBreakGdnToolRoslynAnalyzers: true + BinSkim: true + CredScan: true + +- task: TSAUpload@2 + condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/main')) + displayName: 'TSA upload' + inputs: + tsaVersion: 'TsaV2' + codebase: 'NewOrUpdate' + GdnPublishTsaOnboard: false + GdnPublishTsaConfigFile: '$(Build.SourcesDirectory)\build\jobs\tsaconfig.gdntsa' + GdnPublishTsaExportedResultsPublishable: true + +- task: DeleteFiles@1 + displayName: 'Delete files to make space' + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: '**\*' + +- task: DropValidatorTask@0 + displayName: 'SBOM Validator and Publisher Task' + inputs: + BuildDropPath: '$(Agent.TempDirectory)/artifacts/deploy' + OutputPath: 'output.json' + ValidateSignature: true + Verbosity: 'Verbose' + continueOnError: true diff --git a/.github/workflows/jobs/build.yml b/.github/workflows/jobs/build.yml new file mode 100644 index 0000000000..8bb12db04d --- /dev/null +++ b/.github/workflows/jobs/build.yml @@ -0,0 +1,88 @@ +parameters: + # Default values + unitTest: true + codeCoverage: false + componentGovernance: false + packageArtifacts: false + packageIntegrationTests: false + targetBuildFramework: '' + +steps: +- task: UseDotNet@2 + displayName: 'Use .NET SDK' + inputs: + useGlobalJson: true + +- ${{ if eq(parameters.targetBuildFramework, '') }}: + - task: DotNetCoreCLI@2 + displayName: 'dotnet build $(buildConfiguration)' + inputs: + command: build + arguments: '--configuration $(buildConfiguration) -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="$(assemblySemVer)" -p:FileVersion="$(assemblySemFileVer)" -p:InformationalVersion="$(informationalVersion)" -p:Version="$(majorMinorPatch)" -warnaserror' + workingDirectory: $(System.DefaultWorkingDirectory) + +- ${{ if ne(parameters.targetBuildFramework, '') }}: + - task: DotNetCoreCLI@2 + displayName: 'dotnet build $(buildConfiguration)' + inputs: + command: build + arguments: '--configuration $(buildConfiguration) -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="$(assemblySemVer)" -p:FileVersion="$(assemblySemFileVer)" -p:InformationalVersion="$(informationalVersion)" -p:Version="$(majorMinorPatch)" -warnaserror -f ${{parameters.targetBuildFramework}}' + workingDirectory: $(System.DefaultWorkingDirectory) + +- ${{ if eq(parameters.unitTest, 'true') }}: + - task: DotNetCoreCLI@2 + displayName: 'dotnet test' + inputs: + command: test + projects: '**/*UnitTests/*.csproj' + arguments: '--configuration $(buildConfiguration) --no-build -f ${{parameters.targetBuildFramework}}' + testRunTitle: 'Unit Tests' + +- ${{ if eq(parameters.codeCoverage, 'true') }}: + - task: DotNetCoreCLI@2 + displayName: 'dotnet test with coverage' + inputs: + command: test + projects: '**/*UnitTests/*.csproj' + arguments: '--configuration $(buildConfiguration) --no-build --collect "XPlat Code Coverage" -s "$(build.sourcesDirectory)/CodeCoverage.runsettings" -v normal -f ${{parameters.targetBuildFramework}}' + testRunTitle: 'Unit Tests' + - task: reportgenerator@5 + displayName: 'aggregate code coverage' + condition: succeededOrFailed() + inputs: + reports: '$(Agent.TempDirectory)/*/coverage.cobertura.xml' + reporttypes: 'Cobertura' + targetdir: '$(Agent.TempDirectory)/coverage' + - task: PublishCodeCoverageResults@1 + displayName: 'publish code coverage' + condition: succeededOrFailed() + inputs: + codeCoverageTool: 'Cobertura' + failIfCoverageEmpty: true + summaryFileLocation: '$(Agent.TempDirectory)/coverage/Cobertura.xml' + - task: PublishBuildArtifacts@1 + displayName: 'publish Cobertura.xml' + inputs: + pathToPublish: '$(Agent.TempDirectory)/coverage/Cobertura.xml' + artifactName: 'IntegrationTests' + artifactType: 'container' + +- ${{ if eq(parameters.packageArtifacts, 'true') }}: + # https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/secure-supply-chain/ado-sbom-generator + - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: 'SBOM Generation Task' + inputs: + BuildDropPath: '$(build.artifactStagingDirectory)' + BuildComponentPath: '$(Build.SourcesDirectory)' + - task: PublishBuildArtifacts@1 + displayName: 'Publish SBOM Artifacts' + inputs: + pathToPublish: '$(build.artifactStagingDirectory)' + artifactName: 'deploy' + artifactType: 'container' + +- ${{ if eq(parameters.packageArtifacts, 'true') }}: + - template: package.yml + +- ${{ if eq(parameters.packageIntegrationTests, 'true') }}: + - template: package-integration-tests.yml diff --git a/.github/workflows/jobs/clean-storage-accounts.yml b/.github/workflows/jobs/clean-storage-accounts.yml new file mode 100644 index 0000000000..40c5260f04 --- /dev/null +++ b/.github/workflows/jobs/clean-storage-accounts.yml @@ -0,0 +1,31 @@ +parameters: +- name: environmentName + type: string + +jobs: +- job: "cleanStorageAccounts" + pool: + vmImage: $(WindowsVmImage) + steps: + - task: AzurePowerShell@4 + displayName: 'Clean Storage Accounts' + continueOnError: true + inputs: + azureSubscription: $(ConnectedServiceName) + azurePowerShellVersion: latestVersion + ScriptType: inlineScript + Inline: | + $currentUtcTime = [DateTime]::UtcNow + + $storageAccounts = Get-AzStorageAccount -ResourceGroupName ${{ parameters.environmentName }} + foreach ($storageAccount in $storageAccounts) { + + $storageContainers = Get-AzStorageContainer -Name * -Context $storageAccount.Context + foreach ($container in $storageContainers) { + $ageDiff = $currentUtcTime - $container.CloudBlobContainer.Properties.LastModified.UtcDateTime + if($ageDiff.TotalDays -ge 3) { + Write-Host "Deleting container $($container.Name)" + $container.CloudBlobContainer.Delete() + } + } + } \ No newline at end of file diff --git a/.github/workflows/jobs/docker-add-tag.yml b/.github/workflows/jobs/docker-add-tag.yml new file mode 100644 index 0000000000..031ae5e484 --- /dev/null +++ b/.github/workflows/jobs/docker-add-tag.yml @@ -0,0 +1,28 @@ + +parameters: +- name: sourceTag + type: string +- name: targetTag + type: string + +jobs: +- job: DockerAddTag + pool: + name: '$(DefaultLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - task: AzureCLI@2 + displayName: 'Azure CLI: InlineScript' + inputs: + azureSubscription: $(ConnectedServiceName) + scriptType: bash + scriptLocation: inlineScript + inlineScript: | + az acr login -n $(azureContainerRegistry) + for v in stu3 r4 r4b r5; do + sourceImage="$(azureContainerRegistry)/${v}_fhir-server:${{parameters.sourceTag}}" + targetImage="$(azureContainerRegistry)/${v}_fhir-server:${{parameters.targetTag}}" + docker pull $sourceImage + docker tag $sourceImage $targetImage + docker push $targetImage + done diff --git a/.github/workflows/jobs/docker-build-all.yml b/.github/workflows/jobs/docker-build-all.yml new file mode 100644 index 0000000000..3f6e766c53 --- /dev/null +++ b/.github/workflows/jobs/docker-build-all.yml @@ -0,0 +1,27 @@ +# DESCRIPTION: +# Builds and pushes images for all supported FHIR versions + +parameters: +- name: tag + type: string + +jobs: +- template: docker-build-push.yml + parameters: + version: "R4" + tag: ${{parameters.tag}} + +- template: docker-build-push.yml + parameters: + version: "R4B" + tag: ${{parameters.tag}} + +- template: docker-build-push.yml + parameters: + version: "Stu3" + tag: ${{parameters.tag}} + +- template: docker-build-push.yml + parameters: + version: "R5" + tag: ${{parameters.tag}} diff --git a/.github/workflows/jobs/docker-build-push.yml b/.github/workflows/jobs/docker-build-push.yml new file mode 100644 index 0000000000..77cacb2f94 --- /dev/null +++ b/.github/workflows/jobs/docker-build-push.yml @@ -0,0 +1,40 @@ +# DESCRIPTION: +# Builds and pushes a docker image for a given FHIR version + +parameters: +- name: version + type: string +- name: tag + type: string + +jobs: +- job: '${{parameters.version}}_Docker' + pool: + name: '$(DefaultLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - task: DockerCompose@0 + displayName: 'Build FHIR ${{parameters.version}} Server Image' + inputs: + action: Build services + azureSubscriptionEndpoint: $(azureSubscriptionEndpoint) + azureContainerRegistry: $(azureContainerRegistry) + dockerComposeFile: $(composeLocation) + dockerComposeFileArgs: | + FHIR_VERSION=${{parameters.version}} + ASSEMBLY_VER=$(assemblySemFileVer) + projectName: ${{parameters.version}} + additionalImageTags: ${{parameters.tag}} + + - task: DockerCompose@0 + displayName: 'Push FHIR ${{parameters.version}} Server Image' + inputs: + action: Push services + azureSubscriptionEndpoint: $(azureSubscriptionEndpoint) + azureContainerRegistry: $(azureContainerRegistry) + dockerComposeFile: $(composeLocation) + dockerComposeFileArgs: | + FHIR_VERSION=${{parameters.version}} + ASSEMBLY_VER=$(assemblySemFileVer) + projectName: ${{parameters.version}} + additionalImageTags: ${{parameters.tag}} diff --git a/.github/workflows/jobs/e2e-setup.yml b/.github/workflows/jobs/e2e-setup.yml new file mode 100644 index 0000000000..33890f84d2 --- /dev/null +++ b/.github/workflows/jobs/e2e-setup.yml @@ -0,0 +1,23 @@ +steps: + - task: DownloadBuildArtifacts@0 + inputs: + buildType: 'current' + downloadType: 'single' + downloadPath: '$(System.ArtifactsDirectory)' + artifactName: 'IntegrationTests' + + - task: UseDotNet@2 + inputs: + useGlobalJson: true + + - task: AzureKeyVault@1 + displayName: 'Azure Key Vault: resolute-oss-tenant-info' + inputs: + azureSubscription: $(ConnectedServiceName) + KeyVaultName: 'resolute-oss-tenant-info' + + - task: AzureKeyVault@1 + displayName: 'Azure Key Vault: $(DeploymentEnvironmentName)-ts' + inputs: + azureSubscription: $(ConnectedServiceName) + KeyVaultName: '$(DeploymentEnvironmentName)-ts' diff --git a/.github/workflows/jobs/e2e-tests-extract.yml b/.github/workflows/jobs/e2e-tests-extract.yml new file mode 100644 index 0000000000..1d6a11bf0e --- /dev/null +++ b/.github/workflows/jobs/e2e-tests-extract.yml @@ -0,0 +1,10 @@ +parameters: +- name: version + type: string + +steps: + - task: ExtractFiles@1 + displayName: 'Extract E2E Test Binaries' + inputs: + archiveFilePatterns: '$(System.ArtifactsDirectory)/IntegrationTests/Microsoft.Health.Fhir.${{ parameters.version }}.Tests.E2E.zip' + destinationFolder: '$(Agent.TempDirectory)/E2ETests/' diff --git a/.github/workflows/jobs/e2e-tests.yml b/.github/workflows/jobs/e2e-tests.yml new file mode 100644 index 0000000000..b69ef2351d --- /dev/null +++ b/.github/workflows/jobs/e2e-tests.yml @@ -0,0 +1,139 @@ +parameters: +- name: version + type: string +- name: appServiceName + type: string +- name: appServiceType + type: string + +steps: + - template: e2e-tests-extract.yml + parameters: + version: ${{parameters.version}} + + - task: AzurePowerShell@4 + displayName: 'Set Variables' + inputs: + azureSubscription: $(ConnectedServiceName) + azurePowerShellVersion: latestVersion + ScriptType: inlineScript + Inline: | + $keyVault = "$(DeploymentEnvironmentName)-ts" + $secrets = Get-AzKeyVaultSecret -VaultName $keyVault + + foreach($secret in $secrets) + { + $environmentVariableName = $secret.Name.Replace("--","_") + + $secretValue = Get-AzKeyVaultSecret -VaultName $keyVault -Name $secret.Name + # Replace with -AsPlainText flag when v5.3 of the Az Module is supported + $plainValue = ([System.Net.NetworkCredential]::new("", $secretValue.SecretValue).Password).ToString() + if([string]::IsNullOrEmpty($plainValue)) + { + throw "$($secret.Name) is empty" + } + Write-Host "##vso[task.setvariable variable=$($environmentVariableName)]$($plainValue)" + } + + $storageAccounts = Get-AzStorageAccount -ResourceGroupName $(ResourceGroupName) + $allStorageAccounts = "" + foreach ($storageAccount in $storageAccounts) { + $accKey = Get-AzStorageAccountKey -ResourceGroupName $(ResourceGroupName) -Name $storageAccount.StorageAccountName | Where-Object {$_.KeyName -eq "key1"} + + $storageSecretName = "$($storageAccount.StorageAccountName)_secret" + Write-Host "##vso[task.setvariable variable=$($storageSecretName)]$($accKey.Value)" + $allStorageAccounts += "$($storageSecretName)|$($accKey.Value)|" + } + Write-Host "##vso[task.setvariable variable=AllStorageAccounts]$($allStorageAccounts)" + + $appServiceName = "${{ parameters.appServiceName }}" + $appSettings = (Get-AzWebApp -ResourceGroupName $(ResourceGroupName) -Name $appServiceName).SiteConfig.AppSettings + $acrSettings = $appSettings | where {$_.Name -eq "FhirServer__Operations__ConvertData__ContainerRegistryServers__0"} + $acrLoginServer = $acrSettings[0].Value + $acrAccountName = ($acrLoginServer -split '\.')[0] + $acrPassword = (Get-AzContainerRegistryCredential -ResourceGroupName $(ResourceGroupName) -Name $acrAccountName).Password + Write-Host "##vso[task.setvariable variable=TestContainerRegistryServer]$($acrLoginServer)" + Write-Host "##vso[task.setvariable variable=TestContainerRegistryPassword]$($acrPassword)" + + $exportStoreSettings = $appSettings | where {$_.Name -eq "FhirServer__Operations__Export__StorageAccountUri"} + $exportStoreUri = $exportStoreSettings[0].Value + Write-Host "$exportStoreUri" + $exportStoreAccountName = [System.Uri]::new("$exportStoreUri").Host.Split('.')[0] + $exportStoreKey = Get-AzStorageAccountKey -ResourceGroupName $(ResourceGroupName) -Name "$exportStoreAccountName" | Where-Object {$_.KeyName -eq "key1"} + + Write-Host "##vso[task.setvariable variable=TestExportStoreUri]$($exportStoreUri)" + Write-Host "##vso[task.setvariable variable=TestExportStoreKey]$($exportStoreKey.Value)" + + $integrationStoreSettings = $appSettings | where {$_.Name -eq "FhirServer__Operations__IntegrationDataStore__StorageAccountUri"} + $integrationStoreUri = $integrationStoreSettings[0].Value + Write-Host "$integrationStoreUri" + $integrationStoreAccountName = [System.Uri]::new("$integrationStoreUri").Host.Split('.')[0] + $integrationStoreKey = Get-AzStorageAccountKey -ResourceGroupName $(ResourceGroupName) -Name "$integrationStoreAccountName" | Where-Object {$_.KeyName -eq "key1"} + + Write-Host "##vso[task.setvariable variable=TestIntegrationStoreUri]$($integrationStoreUri)" + Write-Host "##vso[task.setvariable variable=TestIntegrationStoreKey]$($integrationStoreKey.Value)" + + Write-Host "##vso[task.setvariable variable=Resource]$(TestApplicationResource)" + + $secrets = Get-AzKeyVaultSecret -VaultName resolute-oss-tenant-info + + foreach($secret in $secrets) + { + $environmentVariableName = $secret.Name.Replace("--","_") + + $secretValue = Get-AzKeyVaultSecret -VaultName resolute-oss-tenant-info -Name $secret.Name + # Replace with -AsPlainText flag when v5.3 of the Az Module is supported + $plainValue = ([System.Net.NetworkCredential]::new("", $secretValue.SecretValue).Password).ToString() + if([string]::IsNullOrEmpty($plainValue)) + { + throw "$($secret.Name) is empty" + } + Write-Host "##vso[task.setvariable variable=$($environmentVariableName)]$($plainValue)" + } + # ---------------------------------------- + + dotnet dev-certs https + + - task: DotNetCoreCLI@2 + displayName: 'E2E ${{ parameters.version }} ${{parameters.appServiceType}}' + inputs: + command: test + arguments: '"$(Agent.TempDirectory)/E2ETests/**/*${{ parameters.version }}.Tests.E2E*.dll" --blame-hang-timeout 7m --filter "FullyQualifiedName~${{parameters.appServiceType}}&Category!=ExportLongRunning"' + workingDirectory: "$(System.ArtifactsDirectory)" + testRunTitle: '${{ parameters.version }} ${{parameters.appServiceType}}' + env: + 'TestEnvironmentUrl': $(TestEnvironmentUrl) + 'TestEnvironmentUrl_${{ parameters.version }}': $(TestEnvironmentUrl_${{ parameters.version }}) + 'TestEnvironmentUrl_Sql': $(TestEnvironmentUrl_Sql) + 'TestEnvironmentUrl_${{ parameters.version }}_Sql': $(TestEnvironmentUrl_${{ parameters.version }}_Sql) + 'Resource': $(Resource) + 'AllStorageAccounts': $(AllStorageAccounts) + 'TestContainerRegistryServer': $(TestContainerRegistryServer) + 'TestContainerRegistryPassword': $(TestContainerRegistryPassword) + 'TestExportStoreUri': $(TestExportStoreUri) + 'TestExportStoreKey': $(TestExportStoreKey) + 'TestIntegrationStoreUri': $(TestIntegrationStoreUri) + 'TestIntegrationStoreKey': $(TestIntegrationStoreKey) + 'tenant-admin-service-principal-name': $(tenant-admin-service-principal-name) + 'tenant-admin-service-principal-password': $(tenant-admin-service-principal-password) + 'tenant-admin-user-name': $(tenant-admin-user-name) + 'tenant-admin-user-password': $(tenant-admin-user-password) + 'tenant-id': $(tenant-id) + 'app_globalAdminServicePrincipal_id': $(app_globalAdminServicePrincipal_id) + 'app_globalAdminServicePrincipal_secret': $(app_globalAdminServicePrincipal_secret) + 'app_nativeClient_id': $(app_nativeClient_id) + 'app_nativeClient_secret': $(app_nativeClient_secret) + 'app_wrongAudienceClient_id': $(app_wrongAudienceClient_id) + 'app_wrongAudienceClient_secret': $(app_wrongAudienceClient_secret) + 'user_globalAdminUser_id': $(user_globalAdminUser_id) + 'user_globalAdminUser_secret': $(user_globalAdminUser_secret) + 'user_globalConverterUser_id': $(user_globalConverterUser_id) + 'user_globalConverterUser_secret': $(user_globalConverterUser_secret) + 'user_globalExporterUser_id': $(user_globalExporterUser_id) + 'user_globalExporterUser_secret': $(user_globalExporterUser_secret) + 'user_globalImporterUser_id': $(user_globalImporterUser_id) + 'user_globalImporterUser_secret': $(user_globalImporterUser_secret) + 'user_globalReaderUser_id': $(user_globalReaderUser_id) + 'user_globalReaderUser_secret': $(user_globalReaderUser_secret) + 'user_globalWriterUser_id': $(user_globalWriterUser_id) + 'user_globalWriterUser_secret': $(user_globalWriterUser_secret) diff --git a/.github/workflows/jobs/package-integration-tests.yml b/.github/workflows/jobs/package-integration-tests.yml new file mode 100644 index 0000000000..180c259c07 --- /dev/null +++ b/.github/workflows/jobs/package-integration-tests.yml @@ -0,0 +1,17 @@ +steps: + + - task: DotNetCoreCLI@2 + displayName: 'dotnet publish Integration Tests' + inputs: + command: publish + projects: 'test/**/*.csproj' + arguments: '--version-suffix $(build.buildNumber) -o "$(build.binariesdirectory)/IntegrationTests" --configuration $(buildConfiguration) --no-build -f $(defaultBuildFramework)' + publishWebProjects: false + zipAfterPublish: true + + - task: PublishBuildArtifacts@1 + displayName: 'publish Integration Tests' + inputs: + pathToPublish: '$(build.binariesdirectory)/IntegrationTests' + artifactName: 'IntegrationTests' + artifactType: 'container' \ No newline at end of file diff --git a/.github/workflows/jobs/package-web.yml b/.github/workflows/jobs/package-web.yml new file mode 100644 index 0000000000..edc1378081 --- /dev/null +++ b/.github/workflows/jobs/package-web.yml @@ -0,0 +1,14 @@ +parameters: + csproj: '**/*Web.csproj' + +steps: + + # Package web + + - task: DotNetCoreCLI@2 + displayName: 'dotnet publish ${{parameters.csproj}}' + inputs: + command: publish + projects: '${{parameters.csproj}}' + arguments: '--output $(build.artifactStagingDirectory)/web --configuration $(buildConfiguration) --version-suffix $(build.buildNumber) --no-build -f $(defaultBuildFramework)' + publishWebProjects: false \ No newline at end of file diff --git a/.github/workflows/jobs/package.yml b/.github/workflows/jobs/package.yml new file mode 100644 index 0000000000..0fbf89aa9e --- /dev/null +++ b/.github/workflows/jobs/package.yml @@ -0,0 +1,93 @@ +steps: + + # Package web + - template: package-web.yml + parameters: + csproj: '**/Microsoft.Health.Fhir.Stu3.Web.csproj' + + - template: package-web.yml + parameters: + csproj: '**/Microsoft.Health.Fhir.R4.Web.csproj' + + - template: package-web.yml + parameters: + csproj: '**/Microsoft.Health.Fhir.R4B.Web.csproj' + + - template: package-web.yml + parameters: + csproj: '**/Microsoft.Health.Fhir.R5.Web.csproj' + + # Package nugets + - powershell: | + & dotnet pack $(Build.SourcesDirectory) --output $(Build.ArtifactStagingDirectory)/nupkgs --no-build --configuration=Release -p:PackageVersion=$(nuGetVersion) + name: PackNugets + + # Publish artifacts + - task: PublishBuildArtifacts@1 + displayName: 'publish web artifacts' + inputs: + pathToPublish: '$(build.artifactStagingDirectory)/web' + artifactName: 'deploy' + artifactType: 'container' + + - task: PublishBuildArtifacts@1 + displayName: 'publish samples' + inputs: + pathToPublish: './samples/' + artifactName: 'deploy' + artifactType: 'container' + + - task: PublishBuildArtifacts@1 + displayName: 'publish testauthenvironment.json' + inputs: + pathToPublish: './testauthenvironment.json' + artifactName: 'deploy' + artifactType: 'container' + + - task: PublishBuildArtifacts@1 + displayName: 'publish global.json' + inputs: + pathToPublish: './global.json' + artifactName: 'deploy' + artifactType: 'container' + + - task: PublishBuildArtifacts@1 + displayName: 'publish test configuration jsons' + inputs: + pathToPublish: './test/Configuration/' + artifactName: 'deploy' + artifactType: 'container' + + - task: PublishBuildArtifacts@1 + displayName: 'publish release directory' + inputs: + pathToPublish: './release/' + artifactName: 'deploy' + artifactType: 'container' + + - task: PublishBuildArtifacts@1 + displayName: 'publish nuget artifacts' + inputs: + pathtoPublish: '$(build.artifactStagingDirectory)/nupkgs' + artifactName: 'nuget' + publishLocation: 'container' + + - task: CopyFiles@2 + displayName: 'copy symbols' + inputs: + sourceFolder: '$(build.sourcesDirectory)' + contents: | + **/*.pdb + !**/*.UnitTests.pdb + targetFolder: '$(build.artifactStagingDirectory)/symbols' + cleanTargetFolder: true + flattenFolders: true + overWrite: true + + - task: PublishBuildArtifacts@1 + displayName: 'publish symbol artifacts' + inputs: + pathtoPublish: '$(build.artifactStagingDirectory)/symbols' + artifactName: 'symbols' + publishLocation: 'container' + \ No newline at end of file diff --git a/.github/workflows/jobs/provision-healthcheck.yml b/.github/workflows/jobs/provision-healthcheck.yml new file mode 100644 index 0000000000..40107e6ebf --- /dev/null +++ b/.github/workflows/jobs/provision-healthcheck.yml @@ -0,0 +1,26 @@ +parameters: +- name: webAppName + type: string + +steps: +- powershell: | + $webAppName = "${{ parameters.webAppName }}".ToLower() + $healthCheckUrl = "https://$webAppName.azurewebsites.net/health/check" + $healthStatus = 0 + Do { + Start-Sleep -s 5 + Write-Host "Checking: $healthCheckUrl" + + try { + $healthStatus = (Invoke-WebRequest -URI $healthCheckUrl).statuscode + Write-Host "Result: $healthStatus" + } + catch { + Write-Host $PSItem.Exception.Message + } + finally { + $Error.Clear() + } + + } While ($healthStatus -ne 200) + name: PingHealthCheckEndpoint diff --git a/.github/workflows/jobs/provision-sqlServer.yml b/.github/workflows/jobs/provision-sqlServer.yml new file mode 100644 index 0000000000..190add675e --- /dev/null +++ b/.github/workflows/jobs/provision-sqlServer.yml @@ -0,0 +1,44 @@ + +parameters: +- name: resourceGroup + type: string +- name: sqlServerName + type: string +- name: schemaAutomaticUpdatesEnabled + type: string + default: 'auto' +- name: sqlServerAdminPassword + type: string + default: '' + +jobs: +- job: provisionEnvironment + pool: + name: '$(SharedLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - task: AzureKeyVault@1 + displayName: 'Azure Key Vault: resolute-oss-tenant-info' + inputs: + azureSubscription: $(ConnectedServiceName) + KeyVaultName: 'resolute-oss-tenant-info' + + - task: AzurePowerShell@5 + displayName: 'Azure PowerShell script: InlineScript' + inputs: + azureSubscription: $(ConnectedServiceName) + azurePowerShellVersion: latestVersion + ScriptType: inlineScript + Inline: | + Add-Type -AssemblyName System.Web + + $templateParameters = @{ + sqlAdminPassword = "${{parameters.sqlServerAdminPassword}}" + sqlServerName = "${{parameters.sqlServerName}}".ToLower() + sqlSchemaAutomaticUpdatesEnabled = "${{parameters.schemaAutomaticUpdatesEnabled}}" + } + + Write-Host "Provisioning Sql server" + Write-Host "Resource Group: ${{ parameters.resourceGroup }}" + Write-Host "SqlServerName: ${{ parameters.sqlServerName }}" + New-AzResourceGroupDeployment -ResourceGroupName "${{ parameters.resourceGroup }}" -TemplateFile $(System.DefaultWorkingDirectory)/samples/templates/default-sqlServer.json -TemplateParameterObject $templateParameters -Verbose diff --git a/.github/workflows/jobs/redeploy-webapp.yml b/.github/workflows/jobs/redeploy-webapp.yml new file mode 100644 index 0000000000..6845260147 --- /dev/null +++ b/.github/workflows/jobs/redeploy-webapp.yml @@ -0,0 +1,29 @@ +parameters: +- name: version + type: string +- name: webAppName + type: string +- name: subscription + type: string +- name: imageTag + type: string + +jobs: +- job: provisionEnvironment + pool: + name: '$(DefaultLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - task: AzureRmWebAppDeployment@4 + displayName: 'Azure App Service Deploy' + inputs: + azureSubscription: '${{ parameters.subscription }}' + appType: 'webAppContainer' + WebAppName: '${{ parameters.webAppName }}' + DockerNamespace: $(azureContainerRegistry) + DockerRepository: '${{ parameters.version }}_fhir-server' + DockerImageTag: ${{ parameters.imageTag }} + + - template: ./provision-healthcheck.yml + parameters: + webAppName: ${{ parameters.webAppName }} \ No newline at end of file diff --git a/.github/workflows/jobs/run-tests.yml b/.github/workflows/jobs/run-tests.yml new file mode 100644 index 0000000000..d8672f3c1c --- /dev/null +++ b/.github/workflows/jobs/run-tests.yml @@ -0,0 +1,79 @@ +parameters: +- name: version + type: string +- name: keyVaultName + type: string +- name: appServiceName + type: string +jobs: +- job: "integrationTests" + pool: + name: '$(SharedLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - task: DownloadBuildArtifacts@0 + inputs: + buildType: 'current' + downloadType: 'single' + downloadPath: '$(System.ArtifactsDirectory)' + artifactName: 'IntegrationTests' + + - task: ExtractFiles@1 + displayName: 'Extract Integration Test Binaries' + inputs: + archiveFilePatterns: '$(System.ArtifactsDirectory)/IntegrationTests/Microsoft.Health.Fhir.${{ parameters.version }}.Tests.Integration.zip' + destinationFolder: '$(Agent.TempDirectory)/IntegrationTests/' + + - task: UseDotNet@2 + inputs: + useGlobalJson: true + + - task: AzureKeyVault@1 + displayName: 'Azure Key Vault: ${{ parameters.keyVaultName }}' + inputs: + azureSubscription: $(ConnectedServiceName) + KeyVaultName: '${{ parameters.keyVaultName }}' + + - task: AzureKeyVault@1 + displayName: 'Azure Key Vault: ${{ parameters.keyVaultName }}-sql' + inputs: + azureSubscription: $(ConnectedServiceName) + KeyVaultName: '${{ parameters.keyVaultName }}-sql' + + - task: DotNetCoreCLI@2 + displayName: 'Run Integration Tests' + inputs: + command: test + arguments: '"$(Agent.TempDirectory)/IntegrationTests/**/*${{ parameters.version }}.Tests.Integration*.dll" --blame-hang-timeout 15m' + workingDirectory: "$(System.ArtifactsDirectory)" + testRunTitle: '${{ parameters.version }} Integration' + env: + 'CosmosDb:Host': $(CosmosDb--Host) + 'CosmosDb:Key': $(CosmosDb--Key) + 'SqlServer:ConnectionString': $(SqlServer--ConnectionString) + +- job: 'cosmosE2eTests' + dependsOn: [] + pool: + name: '$(SharedLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - template: e2e-setup.yml + - template: e2e-tests.yml + parameters: + version: ${{ parameters.version }} + appServiceName: ${{ parameters.appServiceName }} + appServiceType: 'CosmosDb' + +- job: 'sqlE2eTests' + dependsOn: [] + pool: + name: '$(SharedLinuxPool)' + vmImage: '$(LinuxVmImage)' + steps: + - template: e2e-setup.yml + - template: e2e-tests.yml + parameters: + version: ${{ parameters.version }} + appServiceName: '${{ parameters.appServiceName }}-sql' + appServiceType: 'SqlServer' diff --git a/.github/workflows/jobs/update-semver.yml b/.github/workflows/jobs/update-semver.yml new file mode 100644 index 0000000000..f07e6dda97 --- /dev/null +++ b/.github/workflows/jobs/update-semver.yml @@ -0,0 +1,31 @@ +steps: + +- task: UseDotNet@2 + displayName: 'Use .NET Core sdk (for GitVersion)' + inputs: + packageType: sdk + version: 3.1.x + +- task: UseDotNet@2 + inputs: + useGlobalJson: true + +- powershell: | + dotnet tool install --global GitVersion.Tool + + $gitVersionJson = & 'dotnet-gitversion' | ConvertFrom-Json + + Write-Host "##vso[task.setvariable variable=semVer]$($gitVersionJson.semVer)" + Write-Host "##vso[task.setvariable variable=informationalVersion;isOutput=true]$($gitVersionJson.informationalVersion)" + Write-Host "##vso[task.setvariable variable=majorMinorPatch;isOutput=true]$($gitVersionJson.majorMinorPatch)" + Write-Host "##vso[task.setvariable variable=nuGetVersion;isOutput=true]$($gitVersionJson.semVer)" + Write-Host "##vso[task.setvariable variable=assemblySemVer;isOutput=true]$($gitVersionJson.assemblySemVer)" + Write-Host "##vso[task.setvariable variable=assemblySemFileVer;isOutput=true]$($gitVersionJson.assemblySemFileVer)" + + Write-Host "##vso[build.updatebuildnumber]$($gitVersionJson.semVer)" + name: SetVariablesFromGitVersion + +- powershell: | + Write-Host '----------Variables to use for build----------' + Write-Host 'semVer: $(semVer)' + name: PrintVariablesFromGitVersion diff --git a/.github/workflows/jobs/update-sqlAdminPassword.yml b/.github/workflows/jobs/update-sqlAdminPassword.yml new file mode 100644 index 0000000000..b1d4a2466e --- /dev/null +++ b/.github/workflows/jobs/update-sqlAdminPassword.yml @@ -0,0 +1,18 @@ +steps: + +- task: UseDotNet@2 + displayName: 'Use .NET Core sdk (to generate password)' + inputs: + packageType: sdk + version: 3.1.x + +- task: UseDotNet@2 + inputs: + useGlobalJson: true + +- powershell: | + + $random = -join((((33,35,37,38,42,43,45,46,95) + (48..57) + (65..90) + (97..122) | Get-Random -Count 20) + ((33,35,37,38,42,43,45,46,95) | Get-Random -Count 1) + ((48..57) | Get-Random -Count 1) + ((65..90) | Get-Random -Count 1) + ((97..122) | Get-Random -Count 1) | Get-Random -Count 24) | % {[char]$_}) + Write-Host "##vso[task.setvariable variable=password;isOutput=true]" + + name: SetVariablesFromRandomString From ff0df35582a078e1559cb55100b28b3d34a5ba4f Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 12 Mar 2024 14:30:53 -0700 Subject: [PATCH 002/149] Initial file conversion with test ci pipeline --- .../{workflows/jobs => actions}/analyze.yml | 0 .github/{workflows/jobs => actions}/build.yml | 0 .../clean-storage-accounts.yml | 0 .../jobs => actions}/docker-add-tag.yml | 0 .../jobs => actions}/docker-build-all.yml | 0 .../jobs => actions}/docker-build-push.yml | 0 .../{workflows/jobs => actions}/e2e-setup.yml | 0 .../jobs => actions}/e2e-tests-extract.yml | 0 .../{workflows/jobs => actions}/e2e-tests.yml | 0 .../package-integration-tests.yml | 0 .../jobs => actions}/package-web.yml | 0 .../{workflows/jobs => actions}/package.yml | 0 .../provision-healthcheck.yml | 0 .../jobs => actions}/provision-sqlServer.yml | 0 .../jobs => actions}/redeploy-webapp.yml | 0 .../{workflows/jobs => actions}/run-tests.yml | 0 .../jobs => actions}/update-semver.yml | 0 .../update-sqlAdminPassword.yml | 0 .github/workflows/fhir-oss-ci-pipeline.yml | 296 +----------------- 19 files changed, 15 insertions(+), 281 deletions(-) rename .github/{workflows/jobs => actions}/analyze.yml (100%) rename .github/{workflows/jobs => actions}/build.yml (100%) rename .github/{workflows/jobs => actions}/clean-storage-accounts.yml (100%) rename .github/{workflows/jobs => actions}/docker-add-tag.yml (100%) rename .github/{workflows/jobs => actions}/docker-build-all.yml (100%) rename .github/{workflows/jobs => actions}/docker-build-push.yml (100%) rename .github/{workflows/jobs => actions}/e2e-setup.yml (100%) rename .github/{workflows/jobs => actions}/e2e-tests-extract.yml (100%) rename .github/{workflows/jobs => actions}/e2e-tests.yml (100%) rename .github/{workflows/jobs => actions}/package-integration-tests.yml (100%) rename .github/{workflows/jobs => actions}/package-web.yml (100%) rename .github/{workflows/jobs => actions}/package.yml (100%) rename .github/{workflows/jobs => actions}/provision-healthcheck.yml (100%) rename .github/{workflows/jobs => actions}/provision-sqlServer.yml (100%) rename .github/{workflows/jobs => actions}/redeploy-webapp.yml (100%) rename .github/{workflows/jobs => actions}/run-tests.yml (100%) rename .github/{workflows/jobs => actions}/update-semver.yml (100%) rename .github/{workflows/jobs => actions}/update-sqlAdminPassword.yml (100%) diff --git a/.github/workflows/jobs/analyze.yml b/.github/actions/analyze.yml similarity index 100% rename from .github/workflows/jobs/analyze.yml rename to .github/actions/analyze.yml diff --git a/.github/workflows/jobs/build.yml b/.github/actions/build.yml similarity index 100% rename from .github/workflows/jobs/build.yml rename to .github/actions/build.yml diff --git a/.github/workflows/jobs/clean-storage-accounts.yml b/.github/actions/clean-storage-accounts.yml similarity index 100% rename from .github/workflows/jobs/clean-storage-accounts.yml rename to .github/actions/clean-storage-accounts.yml diff --git a/.github/workflows/jobs/docker-add-tag.yml b/.github/actions/docker-add-tag.yml similarity index 100% rename from .github/workflows/jobs/docker-add-tag.yml rename to .github/actions/docker-add-tag.yml diff --git a/.github/workflows/jobs/docker-build-all.yml b/.github/actions/docker-build-all.yml similarity index 100% rename from .github/workflows/jobs/docker-build-all.yml rename to .github/actions/docker-build-all.yml diff --git a/.github/workflows/jobs/docker-build-push.yml b/.github/actions/docker-build-push.yml similarity index 100% rename from .github/workflows/jobs/docker-build-push.yml rename to .github/actions/docker-build-push.yml diff --git a/.github/workflows/jobs/e2e-setup.yml b/.github/actions/e2e-setup.yml similarity index 100% rename from .github/workflows/jobs/e2e-setup.yml rename to .github/actions/e2e-setup.yml diff --git a/.github/workflows/jobs/e2e-tests-extract.yml b/.github/actions/e2e-tests-extract.yml similarity index 100% rename from .github/workflows/jobs/e2e-tests-extract.yml rename to .github/actions/e2e-tests-extract.yml diff --git a/.github/workflows/jobs/e2e-tests.yml b/.github/actions/e2e-tests.yml similarity index 100% rename from .github/workflows/jobs/e2e-tests.yml rename to .github/actions/e2e-tests.yml diff --git a/.github/workflows/jobs/package-integration-tests.yml b/.github/actions/package-integration-tests.yml similarity index 100% rename from .github/workflows/jobs/package-integration-tests.yml rename to .github/actions/package-integration-tests.yml diff --git a/.github/workflows/jobs/package-web.yml b/.github/actions/package-web.yml similarity index 100% rename from .github/workflows/jobs/package-web.yml rename to .github/actions/package-web.yml diff --git a/.github/workflows/jobs/package.yml b/.github/actions/package.yml similarity index 100% rename from .github/workflows/jobs/package.yml rename to .github/actions/package.yml diff --git a/.github/workflows/jobs/provision-healthcheck.yml b/.github/actions/provision-healthcheck.yml similarity index 100% rename from .github/workflows/jobs/provision-healthcheck.yml rename to .github/actions/provision-healthcheck.yml diff --git a/.github/workflows/jobs/provision-sqlServer.yml b/.github/actions/provision-sqlServer.yml similarity index 100% rename from .github/workflows/jobs/provision-sqlServer.yml rename to .github/actions/provision-sqlServer.yml diff --git a/.github/workflows/jobs/redeploy-webapp.yml b/.github/actions/redeploy-webapp.yml similarity index 100% rename from .github/workflows/jobs/redeploy-webapp.yml rename to .github/actions/redeploy-webapp.yml diff --git a/.github/workflows/jobs/run-tests.yml b/.github/actions/run-tests.yml similarity index 100% rename from .github/workflows/jobs/run-tests.yml rename to .github/actions/run-tests.yml diff --git a/.github/workflows/jobs/update-semver.yml b/.github/actions/update-semver.yml similarity index 100% rename from .github/workflows/jobs/update-semver.yml rename to .github/actions/update-semver.yml diff --git a/.github/workflows/jobs/update-sqlAdminPassword.yml b/.github/actions/update-sqlAdminPassword.yml similarity index 100% rename from .github/workflows/jobs/update-sqlAdminPassword.yml rename to .github/actions/update-sqlAdminPassword.yml diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 809e00b28f..bc0b654516 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -1,285 +1,19 @@ # DESCRIPTION: # Builds, tests, and packages the solution for the main branch. -name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:-r) -trigger: none - -variables: -- template: fhir-oss-ci-test-environment-variables.yml -- template: fhir-oss-build-variables.yml - -stages: -# *********************** Setup *********************** -- stage: UpdateVersion - displayName: 'Determine Semver' - dependsOn: [] - jobs: - - job: Semver - pool: - name: '$(DefaultLinuxPool)' - vmImage: '$(LinuxVmImage)' - steps: - - template: ./jobs/update-semver.yml - -- stage: cleanStorageAccounts - displayName: 'Clean Storage Accounts' - dependsOn: [] - jobs: - - template: ./jobs/clean-storage-accounts.yml - parameters: - environmentName: $(DeploymentEnvironmentName) - -- stage: cleanupIntegrationTestDatabases - displayName: 'Cleanup Integration Test DBs' - dependsOn: [] - jobs: - - job: cleanup - pool: - name: '$(SharedLinuxPool)' - vmImage: '$(LinuxVmImage)' - steps: - - task: AzurePowerShell@5 - displayName: 'Azure PowerShell script: InlineScript' - inputs: - azureSubscription: $(ConnectedServiceName) - azurePowerShellVersion: latestVersion - ScriptType: inlineScript - Inline: | - $testNamePatterns = @("SNAPSHOT*","FHIRCOMPATIBILITYTEST*","FHIRINTEGRATIONTEST*","FHIRRESOURCECHANGEDISABLEDTEST*","BASE*","SNAPSHOT*") - foreach ($pattern in $testNamePatterns) { - $resources = Get-AzResource -ResourceGroupName $(ResourceGroupName) -ResourceType 'Microsoft.Sql/servers/databases' -Name $pattern - foreach ($resource in $resources) { - Write-Host "Cleaning up $($resource.ResourceName)" - Remove-AzResource -ResourceId $resource.ResourceId -Force - } - } - -- stage: BuildUnitTests - displayName: 'Build and run unit tests' - dependsOn: - - UpdateVersion - variables: - assemblySemVer: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.assemblySemVer']] - assemblySemFileVer: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.assemblySemFileVer']] - informationalVersion: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.informationalVersion']] - majorMinorPatch: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.majorMinorPatch']] - nuGetVersion: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.nuGetVersion']] - jobs: - - job: Windows_dotnet8 - pool: - name: '$(DefaultWindowsPool)' +run-name: ${{github.ref_name}}-$(Date:yyyyMMdd)$(Rev:-r) +on: + push: + branches: + - main + +permissions: + id-token: write + contents: read +jobs: + update-version: + name: Determine Semver + runs-on: ubuntu-latest steps: - - template: ./jobs/build.yml - parameters: - targetBuildFramework: $(defaultBuildFramework) - unitTest: false - codeCoverage: true - - job: Linux_dotnet6 - pool: - name: '$(DefaultLinuxPool)' - vmImage: '$(LinuxVmImage)' - steps: - - template: ./jobs/build.yml - parameters: - targetBuildFramework: 'net6.0' - - job: Linux_BuildAndPackage - pool: - name: '$(DefaultLinuxPool)' - vmImage: '$(LinuxVmImage)' - steps: - - template: ./jobs/build.yml - parameters: - codeCoverage: false - unitTest: false - componentGovernance: true - packageArtifacts: true - packageIntegrationTests: true - -- stage: AnalyzeSecurity - displayName: 'Run Security Analysis and Validate' - dependsOn: - - BuildUnitTests - jobs: - - job: Guardian - pool: - name: '$(DefaultWindowsPool)' - - steps: - - template: ./jobs/analyze.yml - -- stage: DockerBuild - displayName: 'Build images' - dependsOn: - - UpdateVersion - variables: - assemblySemFileVer: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.assemblySemFileVer']] - jobs: - - template: ./jobs/docker-build-all.yml - parameters: - tag: $(ImageTag) - -# *********************** Stu3 *********************** -- stage: redeployStu3 - displayName: 'Redeploy STU3 CosmosDB Site' - dependsOn: - - DockerBuild - jobs: - - template: ./jobs/redeploy-webapp.yml - parameters: - version: Stu3 - webAppName: $(DeploymentEnvironmentName) - subscription: $(ConnectedServiceName) - imageTag: $(ImageTag) - -- stage: redeployStu3Sql - displayName: 'Redeploy STU3 SQL Site' - dependsOn: - - DockerBuild - jobs: - - template: ./jobs/redeploy-webapp.yml - parameters: - version: Stu3 - webAppName: $(DeploymentEnvironmentNameSql) - subscription: $(ConnectedServiceName) - imageTag: $(ImageTag) - -- stage: testStu3 - displayName: 'Run Stu3 Tests' - dependsOn: - - BuildUnitTests - - redeployStu3 - - redeployStu3Sql - jobs: - - template: ./jobs/run-tests.yml - parameters: - version: Stu3 - keyVaultName: $(DeploymentEnvironmentName) - appServiceName: $(DeploymentEnvironmentName) - -# *********************** R4 *********************** -- stage: redeployR4 - displayName: 'Redeploy R4 CosmosDB Site' - dependsOn: - - DockerBuild - jobs: - - template: ./jobs/redeploy-webapp.yml - parameters: - version: R4 - webAppName: $(DeploymentEnvironmentNameR4) - subscription: $(ConnectedServiceName) - imageTag: $(ImageTag) - -- stage: redeployR4Sql - displayName: 'Redeploy R4 SQL Site' - dependsOn: - - DockerBuild - jobs: - - template: ./jobs/redeploy-webapp.yml - parameters: - version: R4 - webAppName: $(DeploymentEnvironmentNameR4Sql) - subscription: $(ConnectedServiceName) - imageTag: $(ImageTag) - -- stage: testR4 - displayName: 'Run R4 Tests' - dependsOn: - - BuildUnitTests - - redeployR4 - - redeployR4Sql - jobs: - - template: ./jobs/run-tests.yml - parameters: - version: R4 - keyVaultName: $(DeploymentEnvironmentNameR4) - appServiceName: $(DeploymentEnvironmentNameR4) - -# *********************** R4B *********************** -- stage: redeployR4B - displayName: 'Redeploy R4B CosmosDB Site' - dependsOn: - - DockerBuild - jobs: - - template: ./jobs/redeploy-webapp.yml - parameters: - version: R4B - webAppName: $(DeploymentEnvironmentNameR4B) - subscription: $(ConnectedServiceName) - imageTag: $(ImageTag) - -- stage: redeployR4BSql - displayName: 'Redeploy R4B SQL Site' - dependsOn: - - DockerBuild - jobs: - - template: ./jobs/redeploy-webapp.yml - parameters: - version: R4B - webAppName: $(DeploymentEnvironmentNameR4BSql) - subscription: $(ConnectedServiceName) - imageTag: $(ImageTag) - -- stage: testR4B - displayName: 'Run R4B Tests' - dependsOn: - - BuildUnitTests - - redeployR4B - - redeployR4BSql - jobs: - - template: ./jobs/run-tests.yml - parameters: - version: R4B - keyVaultName: $(DeploymentEnvironmentNameR4B) - appServiceName: $(DeploymentEnvironmentNameR4B) - -# *********************** R5 *********************** -- stage: redeployR5 - displayName: 'Redeploy R5 CosmosDB Site' - dependsOn: - - DockerBuild - jobs: - - template: ./jobs/redeploy-webapp.yml - parameters: - version: R5 - webAppName: $(DeploymentEnvironmentNameR5) - subscription: $(ConnectedServiceName) - imageTag: $(ImageTag) - -- stage: redeployR5Sql - displayName: 'Redeploy R5 SQL Site' - dependsOn: - - DockerBuild - jobs: - - template: ./jobs/redeploy-webapp.yml - parameters: - version: R5 - webAppName: $(DeploymentEnvironmentNameR5Sql) - subscription: $(ConnectedServiceName) - imageTag: $(ImageTag) - -- stage: testR5 - displayName: 'Run R5 Tests' - dependsOn: - - BuildUnitTests - - redeployR5 - - redeployR5Sql - jobs: - - template: ./jobs/run-tests.yml - parameters: - version: R5 - keyVaultName: $(DeploymentEnvironmentNameR5) - appServiceName: $(DeploymentEnvironmentNameR5) - -# *********************** Finalize *********************** -- stage: DockerAddTag - displayName: 'Docker add main tag' - dependsOn: - - testStu3 - - testR4 - - testR4B - - testR5 - jobs: - - template: ./jobs/docker-add-tag.yml - parameters: - sourceTag: $(ImageTag) - targetTag: 'master' + - name: Update Semver + uses: ./.github/actions/update-semver.yml From adb771f66cd2cc04e16b7b2bfa54ca257610ce85 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 12 Mar 2024 15:08:23 -0700 Subject: [PATCH 003/149] Temp workflow dispatch --- .github/workflows/fhir-oss-ci-pipeline.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index bc0b654516..d4ef6c0fca 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -3,9 +3,7 @@ run-name: ${{github.ref_name}}-$(Date:yyyyMMdd)$(Rev:-r) on: - push: - branches: - - main + workflow_dispatch permissions: id-token: write From 797788dc0fdbc00ebb8148be89aad30b0ff39952 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 12 Mar 2024 15:24:22 -0700 Subject: [PATCH 004/149] PR trigger for testing --- .github/{workflows => }/fhir-oss-build-variables.yml | 0 .../{workflows => }/fhir-oss-ci-test-enviroment-variables.yml | 0 .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename .github/{workflows => }/fhir-oss-build-variables.yml (100%) rename .github/{workflows => }/fhir-oss-ci-test-enviroment-variables.yml (100%) diff --git a/.github/workflows/fhir-oss-build-variables.yml b/.github/fhir-oss-build-variables.yml similarity index 100% rename from .github/workflows/fhir-oss-build-variables.yml rename to .github/fhir-oss-build-variables.yml diff --git a/.github/workflows/fhir-oss-ci-test-enviroment-variables.yml b/.github/fhir-oss-ci-test-enviroment-variables.yml similarity index 100% rename from .github/workflows/fhir-oss-ci-test-enviroment-variables.yml rename to .github/fhir-oss-ci-test-enviroment-variables.yml diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index d4ef6c0fca..13edabebbd 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -3,7 +3,7 @@ run-name: ${{github.ref_name}}-$(Date:yyyyMMdd)$(Rev:-r) on: - workflow_dispatch + pull_request permissions: id-token: write From 2cd1d0c14b39e334fe84fff71d654f8876116480 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 12 Mar 2024 15:28:36 -0700 Subject: [PATCH 005/149] Added checkout to get current version of action --- .github/workflows/fhir-oss-ci-pipeline.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 13edabebbd..cbed82ec39 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -9,6 +9,14 @@ permissions: id-token: write contents: read jobs: + checkout: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{github.ref}} update-version: name: Determine Semver runs-on: ubuntu-latest From 3465ec1e9ee3bf21834ef7bd63cc431c2976c689 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 12 Mar 2024 15:32:15 -0700 Subject: [PATCH 006/149] Added need for checkout --- .github/workflows/fhir-oss-ci-pipeline.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index cbed82ec39..dbd73f23fd 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -13,13 +13,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 ref: ${{github.ref}} update-version: name: Determine Semver runs-on: ubuntu-latest + needs: checkout steps: - name: Update Semver uses: ./.github/actions/update-semver.yml From 805e7ea70639a3372f480b37250237c47fb30d3c Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 13 Mar 2024 13:57:59 -0700 Subject: [PATCH 007/149] Testing semver changes --- .github/actions/update-semver.yml | 56 +++++++++++----------- .github/workflows/fhir-oss-ci-pipeline.yml | 11 ++++- 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/.github/actions/update-semver.yml b/.github/actions/update-semver.yml index f07e6dda97..3b34d705bd 100644 --- a/.github/actions/update-semver.yml +++ b/.github/actions/update-semver.yml @@ -1,31 +1,31 @@ -steps: +name: update-semver +description: 'Update the build number with the SemVer from GitVersion' +inputs: + configFilePath: + description: 'Path to the GitVersion configuration file' + required: true + default: './GitVersion.yml' +outputs: + informationalVersion: ${{ steps.SetVariablesFromGitVersion.outputs.informationalVersion }} + majorMinorPatch: ${{ steps.SetVariablesFromGitVersion.outputs.majorMinorPatch }} + nuGetVersion: ${{ steps.SetVariablesFromGitVersion.outputs.nuGetVersion }} + assemblySemVer: ${{ steps.SetVariablesFromGitVersion.outputs.assemblySemVer }} + assemblySemFileVer: ${{ steps.SetVariablesFromGitVersion.outputs.assemblySemFileVer }} + semVer: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} + buildNumber: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} + buildVersion: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} + buildVersionName: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} + buildVersionNameWithBranch: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} -- task: UseDotNet@2 - displayName: 'Use .NET Core sdk (for GitVersion)' - inputs: - packageType: sdk - version: 3.1.x +steps: -- task: UseDotNet@2 - inputs: - useGlobalJson: true - -- powershell: | - dotnet tool install --global GitVersion.Tool - - $gitVersionJson = & 'dotnet-gitversion' | ConvertFrom-Json - - Write-Host "##vso[task.setvariable variable=semVer]$($gitVersionJson.semVer)" - Write-Host "##vso[task.setvariable variable=informationalVersion;isOutput=true]$($gitVersionJson.informationalVersion)" - Write-Host "##vso[task.setvariable variable=majorMinorPatch;isOutput=true]$($gitVersionJson.majorMinorPatch)" - Write-Host "##vso[task.setvariable variable=nuGetVersion;isOutput=true]$($gitVersionJson.semVer)" - Write-Host "##vso[task.setvariable variable=assemblySemVer;isOutput=true]$($gitVersionJson.assemblySemVer)" - Write-Host "##vso[task.setvariable variable=assemblySemFileVer;isOutput=true]$($gitVersionJson.assemblySemFileVer)" - - Write-Host "##vso[build.updatebuildnumber]$($gitVersionJson.semVer)" - name: SetVariablesFromGitVersion + - name: Install GitVersion' + uses: gittools/actions/gitversion/setup@0.13.4 -- powershell: | - Write-Host '----------Variables to use for build----------' - Write-Host 'semVer: $(semVer)' - name: PrintVariablesFromGitVersion + - name: SetVariablesFromGitVersion + id: -p:Version + uses: gittools/actions/gitversion/execute@0.13.4 + with: + configFilePath: './GitVersion.yml' + targetFilePath: ${{github.workspace}} + useConfigFile: true diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index dbd73f23fd..0ce66e67f8 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -17,10 +17,19 @@ jobs: with: fetch-depth: 0 ref: ${{github.ref}} + + - name: Install Latest .Net SDK + uses: actions/setup-dotnet@v4 + + - name: Install Older .Net SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x update-version: name: Determine Semver runs-on: ubuntu-latest needs: checkout steps: - name: Update Semver - uses: ./.github/actions/update-semver.yml + id: semver + uses: ./.github/actions/update-semver From d0e9b234e214b48bc34b3e82435a55a90d8b8f30 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 13 Mar 2024 14:21:01 -0700 Subject: [PATCH 008/149] Moved and renamed update semver action so it gets picked up --- .../action.yml} | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) rename .github/actions/{update-semver.yml => update-semver/action.yml} (72%) diff --git a/.github/actions/update-semver.yml b/.github/actions/update-semver/action.yml similarity index 72% rename from .github/actions/update-semver.yml rename to .github/actions/update-semver/action.yml index 3b34d705bd..a297c68471 100644 --- a/.github/actions/update-semver.yml +++ b/.github/actions/update-semver/action.yml @@ -3,7 +3,7 @@ description: 'Update the build number with the SemVer from GitVersion' inputs: configFilePath: description: 'Path to the GitVersion configuration file' - required: true + required: false default: './GitVersion.yml' outputs: informationalVersion: ${{ steps.SetVariablesFromGitVersion.outputs.informationalVersion }} @@ -16,16 +16,17 @@ outputs: buildVersion: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} buildVersionName: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} buildVersionNameWithBranch: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} +runs: + using: 'composite' + steps: + + - name: Install GitVersion' + uses: gittools/actions/gitversion/setup@0.13.4 -steps: - - - name: Install GitVersion' - uses: gittools/actions/gitversion/setup@0.13.4 - - - name: SetVariablesFromGitVersion - id: -p:Version - uses: gittools/actions/gitversion/execute@0.13.4 - with: - configFilePath: './GitVersion.yml' - targetFilePath: ${{github.workspace}} - useConfigFile: true + - name: SetVariablesFromGitVersion + id: -p:Version + uses: gittools/actions/gitversion/execute@0.13.4 + with: + configFilePath: './GitVersion.yml' + targetFilePath: ${{github.workspace}} + useConfigFile: true From 56668f0b8524e994665b57ab0daeebc4f5503b2f Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 13 Mar 2024 14:33:05 -0700 Subject: [PATCH 009/149] Tweaking semver --- .github/actions/update-semver/action.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/actions/update-semver/action.yml b/.github/actions/update-semver/action.yml index a297c68471..91426a1db5 100644 --- a/.github/actions/update-semver/action.yml +++ b/.github/actions/update-semver/action.yml @@ -5,17 +5,6 @@ inputs: description: 'Path to the GitVersion configuration file' required: false default: './GitVersion.yml' -outputs: - informationalVersion: ${{ steps.SetVariablesFromGitVersion.outputs.informationalVersion }} - majorMinorPatch: ${{ steps.SetVariablesFromGitVersion.outputs.majorMinorPatch }} - nuGetVersion: ${{ steps.SetVariablesFromGitVersion.outputs.nuGetVersion }} - assemblySemVer: ${{ steps.SetVariablesFromGitVersion.outputs.assemblySemVer }} - assemblySemFileVer: ${{ steps.SetVariablesFromGitVersion.outputs.assemblySemFileVer }} - semVer: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} - buildNumber: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} - buildVersion: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} - buildVersionName: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} - buildVersionNameWithBranch: ${{ steps.SetVariablesFromGitVersion.outputs.semVer }} runs: using: 'composite' steps: @@ -24,9 +13,9 @@ runs: uses: gittools/actions/gitversion/setup@0.13.4 - name: SetVariablesFromGitVersion - id: -p:Version + id: version uses: gittools/actions/gitversion/execute@0.13.4 with: - configFilePath: './GitVersion.yml' + configFilePath: ${{inputs.configFilePath}} targetFilePath: ${{github.workspace}} useConfigFile: true From 47b867c950e4fa7aa3a74e13f32016036c7f8cd5 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 13 Mar 2024 14:34:20 -0700 Subject: [PATCH 010/149] Changing run name --- .github/workflows/fhir-oss-ci-pipeline.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 0ce66e67f8..442bf3054b 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -1,7 +1,7 @@ # DESCRIPTION: # Builds, tests, and packages the solution for the main branch. -run-name: ${{github.ref_name}}-$(Date:yyyyMMdd)$(Rev:-r) +run-name: ${{github.ref_name}}-${{github.run_id}} on: pull_request @@ -33,3 +33,5 @@ jobs: - name: Update Semver id: semver uses: ./.github/actions/update-semver + with: + configFilePath: From d3a7af500d9292321d76ac2eb3ce1a8a33dc3d57 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 13 Mar 2024 14:47:37 -0700 Subject: [PATCH 011/149] Semver now similar to dicom --- .github/actions/update-semver/action.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/actions/update-semver/action.yml b/.github/actions/update-semver/action.yml index 91426a1db5..a389ac871e 100644 --- a/.github/actions/update-semver/action.yml +++ b/.github/actions/update-semver/action.yml @@ -5,12 +5,27 @@ inputs: description: 'Path to the GitVersion configuration file' required: false default: './GitVersion.yml' +outputs: + assemblyVersion: + description: The assembly version for the shared components + value: ${{ steps.version.outputs.GitVersion_AssemblySemVer }} + fileVersion: + description: The assembly file version for the shared components + value: ${{ steps.version.outputs.GitVersion_AssemblySemFileVer }} + informationalVersion: + description: The assembly informational version for the shared components + value: ${{ steps.version.outputs.GitVersion_InformationalVersion }} + nugetVersion: + description: The NuGet package version for the shared components + value: ${{ steps.version.outputs.GitVersion_SemVer }} runs: using: 'composite' steps: - name: Install GitVersion' uses: gittools/actions/gitversion/setup@0.13.4 + with: + versionSpec: '5.x' - name: SetVariablesFromGitVersion id: version From 3e6b90dd4cec7e844a63bf9cf7d47e904d1a32a2 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 13 Mar 2024 17:16:03 -0700 Subject: [PATCH 012/149] Removed property from semver call --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 442bf3054b..e5a937ac20 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -33,5 +33,3 @@ jobs: - name: Update Semver id: semver uses: ./.github/actions/update-semver - with: - configFilePath: From 0314029c68bbaca5302e034e651fce9f8a6a1080 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 13 Mar 2024 17:20:31 -0700 Subject: [PATCH 013/149] Removing ref as it is changing the workspace path --- .github/workflows/fhir-oss-ci-pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index e5a937ac20..ea2b30b5f6 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -16,7 +16,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{github.ref}} - name: Install Latest .Net SDK uses: actions/setup-dotnet@v4 From 04c31542f71ff64af87f850301ab96f0296339bc Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 13 Mar 2024 17:37:03 -0700 Subject: [PATCH 014/149] Simplified semver job call --- .github/workflows/fhir-oss-ci-pipeline.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index ea2b30b5f6..9dc7dde3ec 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -24,11 +24,6 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: 6.0.x - update-version: - name: Determine Semver - runs-on: ubuntu-latest - needs: checkout - steps: - - name: Update Semver + - name: Determine Semver id: semver uses: ./.github/actions/update-semver From 585c9fe9ea309de4127ea6f5ee3940599b45a663 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 13 Mar 2024 17:41:36 -0700 Subject: [PATCH 015/149] Version typo --- .github/actions/update-semver/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/update-semver/action.yml b/.github/actions/update-semver/action.yml index a389ac871e..6e950c7848 100644 --- a/.github/actions/update-semver/action.yml +++ b/.github/actions/update-semver/action.yml @@ -23,13 +23,13 @@ runs: steps: - name: Install GitVersion' - uses: gittools/actions/gitversion/setup@0.13.4 + uses: gittools/actions/gitversion/setup@v0.13.4 with: versionSpec: '5.x' - name: SetVariablesFromGitVersion id: version - uses: gittools/actions/gitversion/execute@0.13.4 + uses: gittools/actions/gitversion/execute@v0.13.4 with: configFilePath: ${{inputs.configFilePath}} targetFilePath: ${{github.workspace}} From ccbc744af5d18d421beea8eb34c16db28fc6027a Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 13 Mar 2024 17:50:24 -0700 Subject: [PATCH 016/149] Wrong property in git tools --- .github/actions/update-semver/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/update-semver/action.yml b/.github/actions/update-semver/action.yml index 6e950c7848..9401cb0dfc 100644 --- a/.github/actions/update-semver/action.yml +++ b/.github/actions/update-semver/action.yml @@ -32,5 +32,5 @@ runs: uses: gittools/actions/gitversion/execute@v0.13.4 with: configFilePath: ${{inputs.configFilePath}} - targetFilePath: ${{github.workspace}} + targetPath: ${{github.workspace}} useConfigFile: true From a04ec616cb87e19cf98ba53692233a68beda3dc4 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 14 Mar 2024 10:49:11 -0700 Subject: [PATCH 017/149] Setup actions to create build variables to be reused --- .../actions/setup-build-variables/action.yml | 36 +++++++++++++++++++ .github/actions/setup-ci-variables/action.yml | 17 +++++++++ .github/fhir-oss-build-variables.yml | 36 ------------------- .../fhir-oss-ci-test-enviroment-variables.yml | 10 ------ 4 files changed, 53 insertions(+), 46 deletions(-) create mode 100644 .github/actions/setup-build-variables/action.yml create mode 100644 .github/actions/setup-ci-variables/action.yml delete mode 100644 .github/fhir-oss-build-variables.yml delete mode 100644 .github/fhir-oss-ci-test-enviroment-variables.yml diff --git a/.github/actions/setup-build-variables/action.yml b/.github/actions/setup-build-variables/action.yml new file mode 100644 index 0000000000..69eee98af1 --- /dev/null +++ b/.github/actions/setup-build-variables/action.yml @@ -0,0 +1,36 @@ +name: setup build variables +description: Sets variables used during builds. + +runs: + using: composite + steps: + - name: Set Build Variables + id: defaultVariables + run: | + echo "buildConfiguration=Release" >> "$GITHUB_ENV" + echo "defaultBuildFramework=net8.0" >> "$GITHUB_ENV" + echo "azureSubscriptionEndpoint=docker-build" >> "$GITHUB_ENV" + echo "azureContainerRegistryName=healthplatformregistry" >> "$GITHUB_ENV" + echo "connectedServiceName=Microsoft Health Open Source Subscription" >> "$GITHUB_ENV" + echo "composeLocation=build/docker/docker-compose.yaml" >> "$GITHUB_ENV" + + - name: Set Build Urls using Deployment Environment + run: | + echo "azureContainerRegistry='$azureContainerRegistryName'.azurecr.io" >> "$GITHUB_ENV" + echo "deploymentEnvironmentNameSql='$deploymentEnvironmentName-sql' >> "$GITHUB_ENV" + echo "deploymentEnvironmentNameR4='$deploymentEnvironmentName-r4' >> "$GITHUB_ENV" + echo "deploymentEnvironmentNameR4Sql='$deploymentEnvironmentNameR4'-sql >> "$GITHUB_ENV" + echo "deploymentEnvironmentNameR4B='$deploymentEnvironmentName-r4b' >> "$GITHUB_ENV" + echo "deploymentEnvironmentNameR4BSql='$deploymentEnvironmentNameR4B'-sql >> "$GITHUB_ENV" + echo "deploymentEnvironmentNameR5='$deploymentEnvironmentName'-r5 >> "$GITHUB_ENV" + echo "deploymentEnvironmentNameR5Sql='$deploymentEnvironmentNameR5'-sql >> "$GITHUB_ENV" + echo "testEnvironmentUrl=https://'$deploymentEnvironmentName'.azurewebsites.net >> "$GITHUB_ENV" + echo "testEnvironmentUrl_Sql=https://'$deploymentEnvironmentName'-sql.azurewebsites.net >> "$GITHUB_ENV" + echo "testEnvironmentUrl_R4=https://'$deploymentEnvironmentName'-r4.azurewebsites.net >> "$GITHUB_ENV" + echo "testEnvironmentUrl_R4_Sql=https://'$deploymentEnvironmentName'-r4-sql.azurewebsites.net >> "$GITHUB_ENV" + echo "testEnvironmentUrl_R4B=https://'$deploymentEnvironmentName'-r4b.azurewebsites.net >> "$GITHUB_ENV" + echo "testEnvironmentUrl_R4B_Sql=https://'$deploymentEnvironmentName'-r4b-sql.azurewebsites.net >> "$GITHUB_ENV" + echo "testEnvironmentUrl_R5=https://'$deploymentEnvironmentName'-r5.azurewebsites.net >> "$GITHUB_ENV" + echo "testEnvironmentUrl_R5_Sql=https://'$deploymentEnvironmentName'-r5-sql.azurewebsites.net >> "$GITHUB_ENV" + echo "testClientUrl=https://'$deploymentEnvironmentName'-client/ >> "$GITHUB_ENV" + echo "testApplicationResource=https://'$deploymentEnvironmentName'.'$tenantDomain' >> "$GITHUB_ENV" diff --git a/.github/actions/setup-ci-variables/action.yml b/.github/actions/setup-ci-variables/action.yml new file mode 100644 index 0000000000..03e75a1201 --- /dev/null +++ b/.github/actions/setup-ci-variables/action.yml @@ -0,0 +1,17 @@ +name: setup ci build variables +description: Sets ci build specific variables. + +runs: + using: composite + steps: + - name: Set CI Build Variables + id: defaultVariables + run: | + echo "resourceGroupRegion=southcentralus" >> "$GITHUB_ENV" + echo "resourceGroupRoot=msh-fhir-ci4" >> "$GITHUB_ENV" + echo "appServicePlanName=$resourceGroupRoot-linux" >> "$GITHUB_ENV" + echo "deploymentEnvironmentName=$resourceGroupRoot" >> "$GITHUB_ENV" + echo "resourceGroupName=$resourceGroupRoot" >> "$GITHUB_ENV" + echo "crucibleEnvironmentUrl=https://crucible.mshapis.com/" >> "$GITHUB_ENV" + echo "testEnvironmentName=OSS CI" >> "$GITHUB_ENV" + echo "imageTag=$build.BuildNumber" >> "$GITHUB_ENV" diff --git a/.github/fhir-oss-build-variables.yml b/.github/fhir-oss-build-variables.yml deleted file mode 100644 index 7f28b89720..0000000000 --- a/.github/fhir-oss-build-variables.yml +++ /dev/null @@ -1,36 +0,0 @@ -# DESCRIPTION: -# Variables used during builds. - -variables: - buildConfiguration: 'Release' - defaultBuildFramework: 'net8.0' - azureSubscriptionEndpoint: 'docker-build' - azureContainerRegistryName: 'healthplatformregistry' - azureContainerRegistry: '$(azureContainerRegistryName).azurecr.io' - composeLocation: 'build/docker/docker-compose.yaml' - DeploymentEnvironmentNameSql: '$(DeploymentEnvironmentName)-sql' - DeploymentEnvironmentNameR4: '$(DeploymentEnvironmentName)-r4' - DeploymentEnvironmentNameR4Sql: '$(DeploymentEnvironmentNameR4)-sql' - DeploymentEnvironmentNameR4B: '$(DeploymentEnvironmentName)-r4b' - DeploymentEnvironmentNameR4BSql: '$(DeploymentEnvironmentNameR4B)-sql' - DeploymentEnvironmentNameR5: '$(DeploymentEnvironmentName)-r5' - DeploymentEnvironmentNameR5Sql: '$(DeploymentEnvironmentNameR5)-sql' - TestEnvironmentUrl: 'https://$(DeploymentEnvironmentName).azurewebsites.net' - # These variables are not used in the deployment scripts, but are used in the E2E tests files. - TestEnvironmentUrl_Sql: 'https://$(DeploymentEnvironmentName)-sql.azurewebsites.net' - TestEnvironmentUrl_R4: 'https://$(DeploymentEnvironmentName)-r4.azurewebsites.net' - TestEnvironmentUrl_R4_Sql: 'https://$(DeploymentEnvironmentName)-r4-sql.azurewebsites.net' - TestEnvironmentUrl_R4B: 'https://$(DeploymentEnvironmentName)-r4b.azurewebsites.net' - TestEnvironmentUrl_R4B_Sql: 'https://$(DeploymentEnvironmentName)-r4b-sql.azurewebsites.net' - TestEnvironmentUrl_R5: 'https://$(DeploymentEnvironmentName)-r5.azurewebsites.net' - TestEnvironmentUrl_R5_Sql: 'https://$(DeploymentEnvironmentName)-r5-sql.azurewebsites.net' - #----------------------------------------------------------------------------------------- - TestClientUrl: 'https://$(DeploymentEnvironmentName)-client/' - ConnectedServiceName: 'Microsoft Health Open Source Subscription' - WindowsVmImage: 'windows-latest' - LinuxVmImage: 'ubuntu-latest' - TestApplicationResource: 'https://$(DeploymentEnvironmentName).$(tenantDomain)' - # The following is set by a build Pipeline variable: - # DefaultLinuxPool: 'Azure Pipelines' - # SharedLinuxPool: 'Azure Pipelines' - #----------------------------------------------------------------------------------------- diff --git a/.github/fhir-oss-ci-test-enviroment-variables.yml b/.github/fhir-oss-ci-test-enviroment-variables.yml deleted file mode 100644 index 6afcea9248..0000000000 --- a/.github/fhir-oss-ci-test-enviroment-variables.yml +++ /dev/null @@ -1,10 +0,0 @@ -variables: - ResourceGroupRegion: 'southcentralus' - # Due to deleting a keyvault with purge protection we must use a name other than msh-fhir-ci for 90 days after 5/20/2021. - resourceGroupRoot: 'msh-fhir-ci4' - appServicePlanName: '$(resourceGroupRoot)-linux' - DeploymentEnvironmentName: '$(resourceGroupRoot)' - ResourceGroupName: '$(resourceGroupRoot)' - CrucibleEnvironmentUrl: 'https://crucible.mshapis.com/' - TestEnvironmentName: 'OSS CI' - ImageTag: '$(build.BuildNumber)' From 5577e2a00cd4a2ac9c74c3313d2b19036994c239 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 14 Mar 2024 11:46:17 -0700 Subject: [PATCH 018/149] Added setup variables --- .github/workflows/fhir-oss-ci-pipeline.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 9dc7dde3ec..1e740fe657 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -16,7 +16,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - + - name: Set Build Variables + uses: ./.github/actions/set-build-variables + - name: Set CI Test Variables + uses: ./.github/actions/setup-ci-variables - name: Install Latest .Net SDK uses: actions/setup-dotnet@v4 @@ -27,3 +30,5 @@ jobs: - name: Determine Semver id: semver uses: ./.github/actions/update-semver + - name: Clean Storage Accounts + uses: ./.github/actions/clean-storage-accounts From aaa5027002a491e2b9995662f5e79355827e18d2 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 14 Mar 2024 11:48:47 -0700 Subject: [PATCH 019/149] Wrong path --- .github/workflows/fhir-oss-ci-pipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 1e740fe657..874b502a4a 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -17,7 +17,7 @@ jobs: with: fetch-depth: 0 - name: Set Build Variables - uses: ./.github/actions/set-build-variables + uses: ./.github/actions/setup-build-variables - name: Set CI Test Variables uses: ./.github/actions/setup-ci-variables - name: Install Latest .Net SDK @@ -30,5 +30,5 @@ jobs: - name: Determine Semver id: semver uses: ./.github/actions/update-semver - - name: Clean Storage Accounts - uses: ./.github/actions/clean-storage-accounts + # - name: Clean Storage Accounts + # uses: ./.github/actions/clean-storage-accounts From 2ca4a4b8f207ed04fb7e17f695b068e6df0e48ac Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 14 Mar 2024 12:05:46 -0700 Subject: [PATCH 020/149] Added shell property --- .github/actions/setup-build-variables/action.yml | 2 ++ .github/actions/setup-ci-variables/action.yml | 1 + .github/workflows/fhir-oss-ci-pipeline.yml | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-build-variables/action.yml b/.github/actions/setup-build-variables/action.yml index 69eee98af1..b78873f84b 100644 --- a/.github/actions/setup-build-variables/action.yml +++ b/.github/actions/setup-build-variables/action.yml @@ -6,6 +6,7 @@ runs: steps: - name: Set Build Variables id: defaultVariables + shell: bash run: | echo "buildConfiguration=Release" >> "$GITHUB_ENV" echo "defaultBuildFramework=net8.0" >> "$GITHUB_ENV" @@ -15,6 +16,7 @@ runs: echo "composeLocation=build/docker/docker-compose.yaml" >> "$GITHUB_ENV" - name: Set Build Urls using Deployment Environment + shell: bash run: | echo "azureContainerRegistry='$azureContainerRegistryName'.azurecr.io" >> "$GITHUB_ENV" echo "deploymentEnvironmentNameSql='$deploymentEnvironmentName-sql' >> "$GITHUB_ENV" diff --git a/.github/actions/setup-ci-variables/action.yml b/.github/actions/setup-ci-variables/action.yml index 03e75a1201..50a6936df8 100644 --- a/.github/actions/setup-ci-variables/action.yml +++ b/.github/actions/setup-ci-variables/action.yml @@ -6,6 +6,7 @@ runs: steps: - name: Set CI Build Variables id: defaultVariables + shell: bash run: | echo "resourceGroupRegion=southcentralus" >> "$GITHUB_ENV" echo "resourceGroupRoot=msh-fhir-ci4" >> "$GITHUB_ENV" diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 874b502a4a..72843fcb40 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -1,7 +1,6 @@ # DESCRIPTION: # Builds, tests, and packages the solution for the main branch. -run-name: ${{github.ref_name}}-${{github.run_id}} on: pull_request From abd804390e84dbd68fc5f8ff4eb1e802070bed13 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 15 Mar 2024 09:49:53 -0700 Subject: [PATCH 021/149] Updated clean storage accounts action. Removed setup ci build variables and moved into fhir-oss-ci-pipeline. --- .github/actions/clean-storage-accounts.yml | 31 -------------- .../actions/clean-storage-accounts/action.yml | 29 +++++++++++++ .github/actions/setup-ci-variables/action.yml | 18 -------- .github/workflows/fhir-oss-ci-pipeline.yml | 42 +++++++++++++++---- 4 files changed, 63 insertions(+), 57 deletions(-) delete mode 100644 .github/actions/clean-storage-accounts.yml create mode 100644 .github/actions/clean-storage-accounts/action.yml delete mode 100644 .github/actions/setup-ci-variables/action.yml diff --git a/.github/actions/clean-storage-accounts.yml b/.github/actions/clean-storage-accounts.yml deleted file mode 100644 index 40c5260f04..0000000000 --- a/.github/actions/clean-storage-accounts.yml +++ /dev/null @@ -1,31 +0,0 @@ -parameters: -- name: environmentName - type: string - -jobs: -- job: "cleanStorageAccounts" - pool: - vmImage: $(WindowsVmImage) - steps: - - task: AzurePowerShell@4 - displayName: 'Clean Storage Accounts' - continueOnError: true - inputs: - azureSubscription: $(ConnectedServiceName) - azurePowerShellVersion: latestVersion - ScriptType: inlineScript - Inline: | - $currentUtcTime = [DateTime]::UtcNow - - $storageAccounts = Get-AzStorageAccount -ResourceGroupName ${{ parameters.environmentName }} - foreach ($storageAccount in $storageAccounts) { - - $storageContainers = Get-AzStorageContainer -Name * -Context $storageAccount.Context - foreach ($container in $storageContainers) { - $ageDiff = $currentUtcTime - $container.CloudBlobContainer.Properties.LastModified.UtcDateTime - if($ageDiff.TotalDays -ge 3) { - Write-Host "Deleting container $($container.Name)" - $container.CloudBlobContainer.Delete() - } - } - } \ No newline at end of file diff --git a/.github/actions/clean-storage-accounts/action.yml b/.github/actions/clean-storage-accounts/action.yml new file mode 100644 index 0000000000..8c4283c775 --- /dev/null +++ b/.github/actions/clean-storage-accounts/action.yml @@ -0,0 +1,29 @@ +name: clean storage Accounts +description: Removes blob containers from test storage accounts + +inputs: + environmentName: + description: Deployment environment name + required: true + +runs: + using: 'composite' + steps: + - name: Clean Storage Accounts + uses: azure/powershell@v1 + with: + inlineScript: | + $currentUtcTime = [DateTime]::UtcNow + + $storageAccounts = Get-AzStorageAccount -ResourceGroupName ${{ inputs.environmentName }} + foreach ($storageAccount in $storageAccounts) { + + $storageContainers = Get-AzStorageContainer -Name * -Context $storageAccount.Context + foreach ($container in $storageContainers) { + $ageDiff = $currentUtcTime - $container.CloudBlobContainer.Properties.LastModified.UtcDateTime + if($ageDiff.TotalDays -ge 3) { + Write-Host "Deleting container $($container.Name)" + $container.CloudBlobContainer.Delete() + } + } + } diff --git a/.github/actions/setup-ci-variables/action.yml b/.github/actions/setup-ci-variables/action.yml deleted file mode 100644 index 50a6936df8..0000000000 --- a/.github/actions/setup-ci-variables/action.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: setup ci build variables -description: Sets ci build specific variables. - -runs: - using: composite - steps: - - name: Set CI Build Variables - id: defaultVariables - shell: bash - run: | - echo "resourceGroupRegion=southcentralus" >> "$GITHUB_ENV" - echo "resourceGroupRoot=msh-fhir-ci4" >> "$GITHUB_ENV" - echo "appServicePlanName=$resourceGroupRoot-linux" >> "$GITHUB_ENV" - echo "deploymentEnvironmentName=$resourceGroupRoot" >> "$GITHUB_ENV" - echo "resourceGroupName=$resourceGroupRoot" >> "$GITHUB_ENV" - echo "crucibleEnvironmentUrl=https://crucible.mshapis.com/" >> "$GITHUB_ENV" - echo "testEnvironmentName=OSS CI" >> "$GITHUB_ENV" - echo "imageTag=$build.BuildNumber" >> "$GITHUB_ENV" diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 72843fcb40..741759e28d 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -7,18 +7,33 @@ on: permissions: id-token: write contents: read + +env: + buildConfiguration: Release + defaultBuildFramework: net8.0 + azureSubscriptionEndpoint: docker-build + azureContainerRegistryName: healthplatformregistry + connectedServiceName: Microsoft Health Open Source Subscription + composeLocation: build/docker/docker-compose.yaml + resourceGroupRegion: southcentralus + resourceGroupRoot: msh-fhir-ci4 + crucibleEnvironmentUrl: https://crucible.mshapis.com/ + testEnvironmentName: OSS CI + imageTag: ${{github.run_number}} + jobs: - checkout: - runs-on: ubuntu-latest + setup: + runs-on: [self-hosted, 1ES.Pool=GithubRunPool] + env: + deploymentEnvironmentName: $resourceGroupRoot + appServicePlanName: $resourceGroupRoot-linux + resourceGroupName: $resourceGroupRoot steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set Build Variables - uses: ./.github/actions/setup-build-variables - - name: Set CI Test Variables - uses: ./.github/actions/setup-ci-variables + - name: Install Latest .Net SDK uses: actions/setup-dotnet@v4 @@ -26,8 +41,19 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: 6.0.x + - name: Determine Semver id: semver uses: ./.github/actions/update-semver - # - name: Clean Storage Accounts - # uses: ./.github/actions/clean-storage-accounts + + - name: Azure Login + uses: azure/login@v2 + with: + client-id: ${{secrets.AZURE_CLIENT_ID}} + subscription-id: ${{secrets.AZURE_SUBSCRIPTION_ID}} + tenant-id: ${{secrets.AZURE_TENANT_ID}} + + - name: Clean Storage Accounts + uses: ./.github/actions/clean-storage-accounts + with: + environmentName: $deploymentEnvironmentName From a21accd8b2403075b5f6d78aef9b7a176972ae00 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 15 Mar 2024 09:54:10 -0700 Subject: [PATCH 022/149] Changing pool --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 741759e28d..e1f32207df 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -23,7 +23,7 @@ env: jobs: setup: - runs-on: [self-hosted, 1ES.Pool=GithubRunPool] + runs-on: linux-latest env: deploymentEnvironmentName: $resourceGroupRoot appServicePlanName: $resourceGroupRoot-linux From bc0d82ba76d100fa0161251b49067d6420f5f764 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 15 Mar 2024 10:12:11 -0700 Subject: [PATCH 023/149] Wrong tag --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index e1f32207df..e8d8ec22d1 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -23,7 +23,7 @@ env: jobs: setup: - runs-on: linux-latest + runs-on: ubuntu-latest env: deploymentEnvironmentName: $resourceGroupRoot appServicePlanName: $resourceGroupRoot-linux From 7eb344a832c900ebfe877d5e782015f678837e54 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 15 Mar 2024 10:15:27 -0700 Subject: [PATCH 024/149] Missing input added. --- .github/actions/clean-storage-accounts/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/clean-storage-accounts/action.yml b/.github/actions/clean-storage-accounts/action.yml index 8c4283c775..9a818a08ad 100644 --- a/.github/actions/clean-storage-accounts/action.yml +++ b/.github/actions/clean-storage-accounts/action.yml @@ -12,6 +12,7 @@ runs: - name: Clean Storage Accounts uses: azure/powershell@v1 with: + azPSVersion: "latest" inlineScript: | $currentUtcTime = [DateTime]::UtcNow From d62ee55e66c2c9039fbd3ec53c1930486dab07b7 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 15 Mar 2024 10:20:47 -0700 Subject: [PATCH 025/149] Wrong property call --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index e8d8ec22d1..254c5e7d91 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -56,4 +56,4 @@ jobs: - name: Clean Storage Accounts uses: ./.github/actions/clean-storage-accounts with: - environmentName: $deploymentEnvironmentName + environmentName: $env.deploymentEnvironmentName From 4271fbe02c9bc872e8d4cba44006bf595971a527 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 15 Mar 2024 10:40:00 -0700 Subject: [PATCH 026/149] Moved some variables to repository level due to limitations --- .github/workflows/fhir-oss-ci-pipeline.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 254c5e7d91..63efc4e23d 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -15,19 +15,15 @@ env: azureContainerRegistryName: healthplatformregistry connectedServiceName: Microsoft Health Open Source Subscription composeLocation: build/docker/docker-compose.yaml - resourceGroupRegion: southcentralus - resourceGroupRoot: msh-fhir-ci4 - crucibleEnvironmentUrl: https://crucible.mshapis.com/ - testEnvironmentName: OSS CI imageTag: ${{github.run_number}} jobs: setup: runs-on: ubuntu-latest env: - deploymentEnvironmentName: $resourceGroupRoot - appServicePlanName: $resourceGroupRoot-linux - resourceGroupName: $resourceGroupRoot + deploymentEnvironmentName: $vars.CIRESOURCEGROUPROOT + appServicePlanName: $vars.CIRESOURCEGROUPROOT-linux + resourceGroupName: $vars.CIRESOURCEGROUPROOT steps: - name: Checkout uses: actions/checkout@v4 @@ -56,4 +52,4 @@ jobs: - name: Clean Storage Accounts uses: ./.github/actions/clean-storage-accounts with: - environmentName: $env.deploymentEnvironmentName + environmentName: $vars.CIRESOURCEGROUPROOT From 1e4f71ebe96132910cbce290d9e594852b618f12 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 15 Mar 2024 12:56:42 -0700 Subject: [PATCH 027/149] property update --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 63efc4e23d..9084d23bc8 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -52,4 +52,4 @@ jobs: - name: Clean Storage Accounts uses: ./.github/actions/clean-storage-accounts with: - environmentName: $vars.CIRESOURCEGROUPROOT + environmentName: ${{vars.CIRESOURCEGROUPROOT}} From 5cc4e8d00dcfa3e3c3516b2f4eed98d3f1a4aef5 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 15 Mar 2024 13:34:09 -0700 Subject: [PATCH 028/149] Missing az context --- .github/actions/clean-storage-accounts/action.yml | 2 +- .github/workflows/fhir-oss-ci-pipeline.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/clean-storage-accounts/action.yml b/.github/actions/clean-storage-accounts/action.yml index 9a818a08ad..2b91090852 100644 --- a/.github/actions/clean-storage-accounts/action.yml +++ b/.github/actions/clean-storage-accounts/action.yml @@ -15,7 +15,7 @@ runs: azPSVersion: "latest" inlineScript: | $currentUtcTime = [DateTime]::UtcNow - + Get-AzContext $storageAccounts = Get-AzStorageAccount -ResourceGroupName ${{ inputs.environmentName }} foreach ($storageAccount in $storageAccounts) { diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 9084d23bc8..1e2d89ea55 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -48,6 +48,7 @@ jobs: client-id: ${{secrets.AZURE_CLIENT_ID}} subscription-id: ${{secrets.AZURE_SUBSCRIPTION_ID}} tenant-id: ${{secrets.AZURE_TENANT_ID}} + enable-AzPSSession: true - name: Clean Storage Accounts uses: ./.github/actions/clean-storage-accounts From 4dd3509b22a33c1137c28e9f0f9acec82dbba4e1 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 15 Mar 2024 13:44:36 -0700 Subject: [PATCH 029/149] Created integration test db cleanup action --- .../action.yml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/actions/cleanup-integration-test-databases/action.yml diff --git a/.github/actions/cleanup-integration-test-databases/action.yml b/.github/actions/cleanup-integration-test-databases/action.yml new file mode 100644 index 0000000000..993c861dfb --- /dev/null +++ b/.github/actions/cleanup-integration-test-databases/action.yml @@ -0,0 +1,25 @@ +name: cleanup integration test databases +description: Deletes databases used for integration tests from previous runs + +inputs: + environmentName: + description: Deployment environment name + required: true + +runs: + using: 'composite' + steps: + - name: Remove Integration Test Databases + uses: azure/powershell@v1 + with: + azPSVersion: "latest" + inlineScript: | + Get-AzContext + $testNamePatterns = @("SNAPSHOT*","FHIRCOMPATIBILITYTEST*","FHIRINTEGRATIONTEST*","FHIRRESOURCECHANGEDISABLEDTEST*","BASE*","SNAPSHOT*") + foreach ($pattern in $testNamePatterns) { + $resources = Get-AzResource -ResourceGroupName ${{ inputs.environmentName }} -ResourceType 'Microsoft.Sql/servers/databases' -Name $pattern + foreach ($resource in $resources) { + Write-Host "Cleaning up $($resource.ResourceName)" + Remove-AzResource -ResourceId $resource.ResourceId -Force + } + } From 77595da164477a8bbdecb7578e8774fbdd051471 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 15 Mar 2024 14:46:54 -0700 Subject: [PATCH 030/149] Adding in build job --- .github/actions/dotnet-build/action.yml | 28 ++++++++++++++++++++ .github/workflows/fhir-oss-ci-pipeline.yml | 30 ++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/actions/dotnet-build/action.yml diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml new file mode 100644 index 0000000000..a0b91b46c1 --- /dev/null +++ b/.github/actions/dotnet-build/action.yml @@ -0,0 +1,28 @@ +name: dotnet build +description: Builds the packages and ensures their quality by running tests. +inputs: + assemblyVersion: + description: The scaler assembly's version. + required: true + buildConfiguration: + default: Debug + description: The dotnet build configuration. + required: false + fileVersion: + description: The scaler assembly's file version. + required: true + informationalVersion: + description: The scaler assembly's informational version. + required: true + dotnetVersion: + description: The version of dotnet to use. + required: true + +runs: + using: composite + steps: + - name: Setup dotnet ${{ inputs.dotnetVersion }} + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ inputs.dotnetVersion}} + \ No newline at end of file diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 1e2d89ea55..f7e77feb94 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -54,3 +54,33 @@ jobs: uses: ./.github/actions/clean-storage-accounts with: environmentName: ${{vars.CIRESOURCEGROUPROOT}} + buildonLinux: + runs-on: ubuntu-latest + needs: setup + strategy: + matrix: + dotnet-version: [ '8.0.x', '6.0.x' ] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup dotnet ${{ matrix.dotnet-version }} + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ matrix.dotnet-version }} + + - name: Build + uses: ./.github/actions/dotnet-build + with: + assemblyVersion: ${{steps.semver.outputs.assemblyVersion}} + buildConfiguration: ${{env.buildConfiguration}} + fileVersion: ${{steps.semver.outputs.fileVersion}} + informationalVersion: ${{steps.semver.outputs.informationalVersion}} + dotnetVersion: ${{matrix.dotnet-version}} + # - name: Test + # run: dotnet test --configuration ${{env.buildConfiguration}} + + # - name: Publish + # run: dotnet publish --configuration ${{env.buildConfiguration}} --output ./publish From 61b45ffd1df91179114e3854d470e985120b7cac Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 20 Mar 2024 09:16:48 -0700 Subject: [PATCH 031/149] Added build action. --- .github/actions/dotnet-build/action.yml | 28 ++++++++++++++++++++-- .github/workflows/fhir-oss-ci-pipeline.yml | 8 +------ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index a0b91b46c1..c5e3a71b7c 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -22,7 +22,31 @@ runs: using: composite steps: - name: Setup dotnet ${{ inputs.dotnetVersion }} - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ inputs.dotnetVersion}} - \ No newline at end of file + + - name: Restore Dependencies + shell: bash + run: dotnet restore + + - name: Build + shell: bash + run: dotnet build --configuration $(inputs.buildConfiguration) -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="$(inputs.assemblyVersion)" -p:FileVersion="$(inputs.fileVersion)" -p:InformationalVersion="$(inputs.informationalVersion)" -p:Version="$(majorMinorPatch)" -warnaserror -f ${{inputs.dotnetVersion}} + + - name: Test + shell: bash + run: dotnet test --no-restore --no-build --verbosity normal -f ${{ inputs.dotnetVersion}} --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' +# Code coverage? How often to trigger diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index f7e77feb94..64f609161a 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -10,7 +10,6 @@ permissions: env: buildConfiguration: Release - defaultBuildFramework: net8.0 azureSubscriptionEndpoint: docker-build azureContainerRegistryName: healthplatformregistry connectedServiceName: Microsoft Health Open Source Subscription @@ -33,11 +32,6 @@ jobs: - name: Install Latest .Net SDK uses: actions/setup-dotnet@v4 - - name: Install Older .Net SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 6.0.x - - name: Determine Semver id: semver uses: ./.github/actions/update-semver @@ -67,7 +61,7 @@ jobs: fetch-depth: 0 - name: Setup dotnet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ matrix.dotnet-version }} From 940761bc8a1069e05a09a4f1fb94a74ab929679d Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 20 Mar 2024 10:55:18 -0700 Subject: [PATCH 032/149] Updated variables references. --- .github/actions/dotnet-build/action.yml | 7 +++++-- .github/actions/update-semver/action.yml | 3 +++ .github/workflows/fhir-oss-ci-pipeline.yml | 6 +----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index c5e3a71b7c..0fa21b1ed8 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -17,6 +17,9 @@ inputs: dotnetVersion: description: The version of dotnet to use. required: true + majorMinorPatch: + description: The major.minor.patch version to use. + required: true runs: using: composite @@ -32,11 +35,11 @@ runs: - name: Build shell: bash - run: dotnet build --configuration $(inputs.buildConfiguration) -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="$(inputs.assemblyVersion)" -p:FileVersion="$(inputs.fileVersion)" -p:InformationalVersion="$(inputs.informationalVersion)" -p:Version="$(majorMinorPatch)" -warnaserror -f ${{inputs.dotnetVersion}} + run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror -f ${{inputs.dotnetVersion}} - name: Test shell: bash - run: dotnet test --no-restore --no-build --verbosity normal -f ${{ inputs.dotnetVersion}} --collect:"XPlat Code Coverage" --results-directory ./coverage + run: dotnet test --no-restore --no-build --verbosity normal -f ${{inputs.dotnetVersion}} --collect:"XPlat Code Coverage" --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 with: diff --git a/.github/actions/update-semver/action.yml b/.github/actions/update-semver/action.yml index 9401cb0dfc..6a7c4b1a18 100644 --- a/.github/actions/update-semver/action.yml +++ b/.github/actions/update-semver/action.yml @@ -18,6 +18,9 @@ outputs: nugetVersion: description: The NuGet package version for the shared components value: ${{ steps.version.outputs.GitVersion_SemVer }} + majorMinorPatch: + description: The major.minor.patch version for the shared components + value: ${{ steps.version.outputs.GitVersion_MajorMinorPatch }} runs: using: 'composite' steps: diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 64f609161a..26cadcde38 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -73,8 +73,4 @@ jobs: fileVersion: ${{steps.semver.outputs.fileVersion}} informationalVersion: ${{steps.semver.outputs.informationalVersion}} dotnetVersion: ${{matrix.dotnet-version}} - # - name: Test - # run: dotnet test --configuration ${{env.buildConfiguration}} - - # - name: Publish - # run: dotnet publish --configuration ${{env.buildConfiguration}} --output ./publish + majorMinorPatch: ${{steps.semver.outputs.majorMinorPatch}} From 3ef15c87ed3fff6d48b157c8ce59213f6430718a Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 20 Mar 2024 15:00:37 -0700 Subject: [PATCH 033/149] Working on multiple build targets --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 0fa21b1ed8..ddd429a106 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -35,7 +35,7 @@ runs: - name: Build shell: bash - run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror -f ${{inputs.dotnetVersion}} + run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror - name: Test shell: bash From 56962784f9375c00af09935e2b9842205f79df0f Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 20 Mar 2024 15:00:51 -0700 Subject: [PATCH 034/149] Modified build targets --- .github/workflows/fhir-oss-ci-pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 26cadcde38..02378797c0 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -54,6 +54,7 @@ jobs: strategy: matrix: dotnet-version: [ '8.0.x', '6.0.x' ] + targetFrameworks: [ 'net8', 'net6'] steps: - name: Checkout uses: actions/checkout@v4 From 6502ed880ca289569be8144a65636257f2baa166 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 20 Mar 2024 17:39:06 -0700 Subject: [PATCH 035/149] Had wrong output properties for semver --- .github/actions/update-semver/action.yml | 20 ++++++++++---------- .github/workflows/fhir-oss-ci-pipeline.yml | 1 - 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/actions/update-semver/action.yml b/.github/actions/update-semver/action.yml index 6a7c4b1a18..b793cb74e8 100644 --- a/.github/actions/update-semver/action.yml +++ b/.github/actions/update-semver/action.yml @@ -7,20 +7,20 @@ inputs: default: './GitVersion.yml' outputs: assemblyVersion: - description: The assembly version for the shared components - value: ${{ steps.version.outputs.GitVersion_AssemblySemVer }} + description: The assembly version for the build + value: ${{ steps.version.outputs.assemblySemVer }} fileVersion: - description: The assembly file version for the shared components - value: ${{ steps.version.outputs.GitVersion_AssemblySemFileVer }} + description: The assembly file version for the build + value: ${{ steps.version.outputs.assemblySemFileVer }} informationalVersion: - description: The assembly informational version for the shared components - value: ${{ steps.version.outputs.GitVersion_InformationalVersion }} + description: The assembly informational version for the build + value: ${{ steps.version.outputs.informationalVersion }} nugetVersion: - description: The NuGet package version for the shared components - value: ${{ steps.version.outputs.GitVersion_SemVer }} + description: The NuGet package version for the build + value: ${{ steps.version.outputs.semVer }} majorMinorPatch: - description: The major.minor.patch version for the shared components - value: ${{ steps.version.outputs.GitVersion_MajorMinorPatch }} + description: The major.minor.patch version for the build + value: ${{ steps.version.outputs.majorMinorPatch }} runs: using: 'composite' steps: diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 02378797c0..26cadcde38 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -54,7 +54,6 @@ jobs: strategy: matrix: dotnet-version: [ '8.0.x', '6.0.x' ] - targetFrameworks: [ 'net8', 'net6'] steps: - name: Checkout uses: actions/checkout@v4 From 274c76b2251dbd6ef79ad0ec8f4941d4ac3c75cf Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 09:27:36 -0700 Subject: [PATCH 036/149] Fixing output mapping --- .github/workflows/fhir-oss-ci-pipeline.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 26cadcde38..110fa04937 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -33,7 +33,6 @@ jobs: uses: actions/setup-dotnet@v4 - name: Determine Semver - id: semver uses: ./.github/actions/update-semver - name: Azure Login @@ -68,9 +67,9 @@ jobs: - name: Build uses: ./.github/actions/dotnet-build with: - assemblyVersion: ${{steps.semver.outputs.assemblyVersion}} + assemblyVersion: ${{needs.setup.outputs.assemblyVersion}} buildConfiguration: ${{env.buildConfiguration}} - fileVersion: ${{steps.semver.outputs.fileVersion}} - informationalVersion: ${{steps.semver.outputs.informationalVersion}} + fileVersion: ${{needs.setup.outputs.fileVersion}} + informationalVersion: ${{needs.setup.outputs.informationalVersion}} dotnetVersion: ${{matrix.dotnet-version}} - majorMinorPatch: ${{steps.semver.outputs.majorMinorPatch}} + majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} From 1f4ccc5dd89f672e89c0689e42c354d9836bfc56 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 09:43:53 -0700 Subject: [PATCH 037/149] Updating output of semver --- .github/actions/update-semver/action.yml | 10 +++++----- .github/workflows/fhir-oss-ci-pipeline.yml | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/actions/update-semver/action.yml b/.github/actions/update-semver/action.yml index b793cb74e8..ef491516c1 100644 --- a/.github/actions/update-semver/action.yml +++ b/.github/actions/update-semver/action.yml @@ -8,19 +8,19 @@ inputs: outputs: assemblyVersion: description: The assembly version for the build - value: ${{ steps.version.outputs.assemblySemVer }} + value: ${{ steps.version.outputs.GitVersion_AssemblySemVer }} fileVersion: description: The assembly file version for the build - value: ${{ steps.version.outputs.assemblySemFileVer }} + value: ${{ steps.version.outputs.GitVersion_AssemblySemFileVer }} informationalVersion: description: The assembly informational version for the build - value: ${{ steps.version.outputs.informationalVersion }} + value: ${{ steps.version.outputs.GitVersion_InformationalVersion }} nugetVersion: description: The NuGet package version for the build - value: ${{ steps.version.outputs.semVer }} + value: ${{ steps.version.outputs.GitVersion_SemVer }} majorMinorPatch: description: The major.minor.patch version for the build - value: ${{ steps.version.outputs.majorMinorPatch }} + value: ${{ steps.version.outputs.GitVersion_MajorMinorPatch }} runs: using: 'composite' steps: diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 110fa04937..eb96c0afd1 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -33,6 +33,7 @@ jobs: uses: actions/setup-dotnet@v4 - name: Determine Semver + id: version uses: ./.github/actions/update-semver - name: Azure Login @@ -67,9 +68,9 @@ jobs: - name: Build uses: ./.github/actions/dotnet-build with: - assemblyVersion: ${{needs.setup.outputs.assemblyVersion}} + assemblyVersion: ${{needs.setup.version.outputs.assemblyVersion}} buildConfiguration: ${{env.buildConfiguration}} - fileVersion: ${{needs.setup.outputs.fileVersion}} - informationalVersion: ${{needs.setup.outputs.informationalVersion}} + fileVersion: ${{needs.setup.version.outputs.fileVersion}} + informationalVersion: ${{needs.setup.version.outputs.informationalVersion}} dotnetVersion: ${{matrix.dotnet-version}} - majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + majorMinorPatch: ${{needs.setup.version.outputs.majorMinorPatch}} From 5c1a84b1721f3a83663f46397a4525915c3312eb Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 09:57:39 -0700 Subject: [PATCH 038/149] Further output param adjustment --- .github/workflows/fhir-oss-ci-pipeline.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index eb96c0afd1..e413d08789 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -23,6 +23,11 @@ jobs: deploymentEnvironmentName: $vars.CIRESOURCEGROUPROOT appServicePlanName: $vars.CIRESOURCEGROUPROOT-linux resourceGroupName: $vars.CIRESOURCEGROUPROOT + outputs: + assemblyVersion: ${{ steps.version.outputs.assemblyVersion }} + fileVersion: ${{ steps.version.outputs.fileVersion }} + informationalVersion: ${{ steps.version.outputs.informationalVersion }} + majorMinorPatch: ${{ steps.version.outputs.majorMinorPatch }} steps: - name: Checkout uses: actions/checkout@v4 @@ -68,9 +73,9 @@ jobs: - name: Build uses: ./.github/actions/dotnet-build with: - assemblyVersion: ${{needs.setup.version.outputs.assemblyVersion}} + assemblyVersion: ${{needs.setup.outputs.assemblyVersion}} buildConfiguration: ${{env.buildConfiguration}} - fileVersion: ${{needs.setup.version.outputs.fileVersion}} - informationalVersion: ${{needs.setup.version.outputs.informationalVersion}} + fileVersion: ${{needs.setup.outputs.fileVersion}} + informationalVersion: ${{needs.setup.outputs.informationalVersion}} dotnetVersion: ${{matrix.dotnet-version}} - majorMinorPatch: ${{needs.setup.version.outputs.majorMinorPatch}} + majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} From 4d09faad63c5459548a541ff4d2e115038a198a0 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 10:49:13 -0700 Subject: [PATCH 039/149] Specifying unittest project to run --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index ddd429a106..c44bb385b8 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,7 @@ runs: - name: Test shell: bash - run: dotnet test --no-restore --no-build --verbosity normal -f ${{inputs.dotnetVersion}} --collect:"XPlat Code Coverage" --results-directory ./coverage + run: dotnet test '**/*UnitTests/*.csproj' --no-restore --no-build --verbosity normal -f ${{inputs.dotnetVersion}} --collect:"XPlat Code Coverage" --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 with: From 8ec2d8a12c04ddfe186a5e90c787e30303957a63 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 11:04:50 -0700 Subject: [PATCH 040/149] Fixing test call --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index c44bb385b8..15be811548 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,7 @@ runs: - name: Test shell: bash - run: dotnet test '**/*UnitTests/*.csproj' --no-restore --no-build --verbosity normal -f ${{inputs.dotnetVersion}} --collect:"XPlat Code Coverage" --results-directory ./coverage + run: dotnet test **/*UnitTests/*.csproj --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 with: From 08314cab1c736ac5418f6af57c99c5c650a8cac9 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 11:44:17 -0700 Subject: [PATCH 041/149] Changed property for unit test run --- .github/actions/dotnet-build/action.yml | 23 ++++++++++++++++++---- .github/workflows/fhir-oss-ci-pipeline.yml | 16 ++++++++++++++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 15be811548..0e5785cc8a 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -35,11 +35,11 @@ runs: - name: Build shell: bash - run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build Microsoft.Health.Fhir.sln --output output--configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror - name: Test shell: bash - run: dotnet test **/*UnitTests/*.csproj --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage + run: dotnet test **/*UnitTests/*.csproj --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage" -s "CodeCoverage.runsettings" -v normal --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 with: @@ -51,5 +51,20 @@ runs: hide_complexity: true indicators: true output: both - thresholds: '60 80' -# Code coverage? How often to trigger + thresholds: '60 80' + # - run: mkdir -p coverage + # shell: bash + # - run: mkdir -p artifacts + # shell: bash + # - name: actions/upload-artifact + # uses: actions/upload-artifact@v4 + # with: + # name: fhirBuild-${{inputs.dotnetVersion}} + # path: artifacts + # retention-days: 1 + # - name: Upload Code Coverage Results + # uses: actions/upload-artifact@v4 + # with: + # name: fhirBuild-${{inputs.dotnetVersion}} + # path: artifacts + # retention-days: 1 diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index e413d08789..953e6de5a5 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -8,6 +8,11 @@ permissions: id-token: write contents: read +defaults: + run: + working-directory: src + shell: bash + env: buildConfiguration: Release azureSubscriptionEndpoint: docker-build @@ -53,7 +58,7 @@ jobs: uses: ./.github/actions/clean-storage-accounts with: environmentName: ${{vars.CIRESOURCEGROUPROOT}} - buildonLinux: + buildAndUnitTest: runs-on: ubuntu-latest needs: setup strategy: @@ -79,3 +84,12 @@ jobs: informationalVersion: ${{needs.setup.outputs.informationalVersion}} dotnetVersion: ${{matrix.dotnet-version}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + runIntegrationTests: + runs-on: ubuntu-latest + needs : buildAndUnitTest + steps: + - name: Download Build Artifact for Testing + uses: actions/download-artifact@v4 + with: + name: fhirBuild-8.0.x + path: artifacts From 7065e5ffa914b6f8b8c7d05c550f524ca30c6842 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 11:55:48 -0700 Subject: [PATCH 042/149] REmoving solution from build command --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 0e5785cc8a..8b1c16f9d0 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -35,7 +35,7 @@ runs: - name: Build shell: bash - run: dotnet build Microsoft.Health.Fhir.sln --output output--configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build --output output --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror - name: Test shell: bash From 49e3fe7579842190138dd36523cde262a6c233c7 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 12:12:59 -0700 Subject: [PATCH 043/149] Removed output directory for build since it is a solution this won't work. --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 8b1c16f9d0..e200d6eda9 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -35,7 +35,7 @@ runs: - name: Build shell: bash - run: dotnet build --output output --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror - name: Test shell: bash From f255ccfc689e44dedff82832c395b8da7c39779b Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 12:49:30 -0700 Subject: [PATCH 044/149] Ironing out test properties --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index e200d6eda9..3efb2b8dc3 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,7 @@ runs: - name: Test shell: bash - run: dotnet test **/*UnitTests/*.csproj --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage" -s "CodeCoverage.runsettings" -v normal --results-directory ./coverage + run: dotnet test **/*UnitTests/*.csproj --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal --collect:"XPlat Code Coverage" -s "CodeCoverage.runsettings" -v normal --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 with: From 5cec7ac364607c0d46e854fd9fb8316c09554d52 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 13:07:35 -0700 Subject: [PATCH 045/149] Removed duplicated property --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 3efb2b8dc3..70b6b3e648 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,7 @@ runs: - name: Test shell: bash - run: dotnet test **/*UnitTests/*.csproj --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal --collect:"XPlat Code Coverage" -s "CodeCoverage.runsettings" -v normal --results-directory ./coverage + run: dotnet test **/*UnitTests/*.csproj --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal --collect:"XPlat Code Coverage" -s "CodeCoverage.runsettings" --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 with: From b5ad1fa54a4fc641beac390ec7faaaeac1fd0d90 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 13:28:15 -0700 Subject: [PATCH 046/149] Removed code coverage as it does not appear to be working --- .github/actions/dotnet-build/action.yml | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 70b6b3e648..02f5500d7a 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,19 +39,19 @@ runs: - name: Test shell: bash - run: dotnet test **/*UnitTests/*.csproj --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal --collect:"XPlat Code Coverage" -s "CodeCoverage.runsettings" --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' + run: dotnet test **/*UnitTests/*.csproj --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + # - 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' # - run: mkdir -p coverage # shell: bash # - run: mkdir -p artifacts From 79f49b85341a0a6accd0ef77b36c6b929c702efe Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 13:55:30 -0700 Subject: [PATCH 047/149] Project path update --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 02f5500d7a..5bd37b4af5 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,7 @@ runs: - name: Test shell: bash - run: dotnet test **/*UnitTests/*.csproj --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "**\*UnitTests\*.csproj" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: From 76c58088e779ed5cabf11b86495412e175e11008 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 14:10:30 -0700 Subject: [PATCH 048/149] Pathing update --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 5bd37b4af5..802c43695b 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,7 @@ runs: - name: Test shell: bash - run: dotnet test "**\*UnitTests\*.csproj" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "./**/*UnitTests/*.csproj" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: From e77eec8567f50ad4aafbb1f84230d5087213b521 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 21 Mar 2024 15:03:45 -0700 Subject: [PATCH 049/149] Updating path of project --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 802c43695b..bd5e13ce70 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,7 @@ runs: - name: Test shell: bash - run: dotnet test "./**/*UnitTests/*.csproj" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "./Test/*UnitTests/*.csproj" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: From a860ed6c66d47be4c06608c8b6957173db86aa77 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 22 Mar 2024 11:32:33 -0700 Subject: [PATCH 050/149] Update unit test path --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index bd5e13ce70..112e146125 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,7 @@ runs: - name: Test shell: bash - run: dotnet test "./Test/*UnitTests/*.csproj" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "${{github.workspace}}/Test/*UnitTests/*.csproj" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: From 80d8b6b83fe781aefd70c7a8178e14b461cc5bc0 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 22 Mar 2024 11:54:57 -0700 Subject: [PATCH 051/149] Updating to point to sln as the wild cards are not supported --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 112e146125..22c55bdbb7 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,7 @@ runs: - name: Test shell: bash - run: dotnet test "${{github.workspace}}/Test/*UnitTests/*.csproj" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: From b49225a3c47c446b9992e308a7a19268da7064d7 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 22 Mar 2024 12:44:31 -0700 Subject: [PATCH 052/149] Updating test settings path --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 22c55bdbb7..76fd64d73f 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,7 @@ runs: - name: Test shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" --settings test/Configuration/testconfiguration.json --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: From 006bf9f8fa842ad747866edcc205f0622f36b4f8 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 22 Mar 2024 16:07:03 -0700 Subject: [PATCH 053/149] Added test filter to only run unit tests --- .github/actions/dotnet-build/action.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 76fd64d73f..16c9e133f7 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -39,7 +39,15 @@ runs: - name: Test shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" --settings test/Configuration/testconfiguration.json --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" --filter "FullyQualifiedName\~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + + # - name: Publish Artifacts + # shell: bash + # run: dotnet publish "Microsoft.Health.Fhir.sln" --output $(Build.ArtifactStagingDirectory)/web --configuration ${{inputs.buildConfiguration}} --no-build -f $(defaultBuildFramework) + # - name: Pack nugets + # shell: bash + # run: dotnet pack "Microsoft.Health.Fhir.sln" --output $(Build.ArtifactStagingDirectory)/nupkgs --no-build --configuration=Release -p:PackageVersion=${{inputs.nugetVersion}} + #Try pack command here to see if it picks up both framework outputs. It may not without referencing output of each job # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: From 1c1eb0aec9b502994c4aa45ef4fd0c65cca4f0bd Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 08:55:16 -0700 Subject: [PATCH 054/149] Added SBOM task and initial artifact upload to use between jobs. --- .github/actions/dotnet-build/action.yml | 5 ++++- .github/workflows/fhir-oss-ci-pipeline.yml | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 16c9e133f7..74dee3c24e 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -20,6 +20,9 @@ inputs: majorMinorPatch: description: The major.minor.patch version to use. required: true + buildOutput: + description: The output directory for the build. + required: true runs: using: composite @@ -35,7 +38,7 @@ runs: - name: Build shell: bash - run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror --output ${{inputs.buildOutput}} - name: Test shell: bash diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 953e6de5a5..fdb4fe807d 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -84,6 +84,18 @@ jobs: informationalVersion: ${{needs.setup.outputs.informationalVersion}} dotnetVersion: ${{matrix.dotnet-version}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + buildOutput: ${{github.workspace}}/artifacts + - name: Generate SBOM + run: | + curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64 + chmod +x $RUNNER_TEMP/sbom-tool + $RUNNER_TEMP/sbom-tool generate -b ./buildOutput -bc . -V Verbose + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4 + with: + path: buildOutput + runIntegrationTests: runs-on: ubuntu-latest needs : buildAndUnitTest From 723dd4f40e5290f809d277b6ffdf9be4119e06d0 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 10:23:53 -0700 Subject: [PATCH 055/149] SBOM with initial artifact upload. --- .github/actions/dotnet-build/action.yml | 6 +--- .../package-web-build-artifacts/action.yml | 35 +++++++++++++++++++ .github/actions/update-semver/action.yml | 2 +- .github/workflows/fhir-oss-ci-pipeline.yml | 19 ++++++++-- 4 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 .github/actions/package-web-build-artifacts/action.yml diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 74dee3c24e..34c9fc0b42 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -20,10 +20,6 @@ inputs: majorMinorPatch: description: The major.minor.patch version to use. required: true - buildOutput: - description: The output directory for the build. - required: true - runs: using: composite steps: @@ -38,7 +34,7 @@ runs: - name: Build shell: bash - run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror --output ${{inputs.buildOutput}} + run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror - name: Test shell: bash diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml new file mode 100644 index 0000000000..5ba3d07712 --- /dev/null +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -0,0 +1,35 @@ +name: Package Web Build Artifacts +description: 'Packages the web build artifacts for deployment' +inputs: + fhirSchemaVersion: + description: 'The FHIR schema version to package' + required: true + majorMinorPatch: + description: 'The version of the Nuget package' + required: true + outputPath: + description: 'The path to the output directory' + required: true + buildConfiguration: + description: 'The build configuration to use' + required: true + dotnetVerison: + description: 'The version of dotnet to use' + required: true + semVer: + description: 'The SemVer to use' + required: true +runs: + using: 'composite' + steps: + - name: Create Nuget packages + shell: bash + run: | + echo "Creating Nuget packages for FHIR schema version ${{inputs.fhirSchemaVersion}}" + dotnet pack ${{github.workspace}} --output ${{input.outputPath}}/nupkgs --no-build --configuration=${{inputs.buildConfiguration}} -p:PackageVersion=${{inputs.majorMinorPatch}} + - name: Package Web Artifacts + shell: bash + run: | + echo "Packaging web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" + dotnet publish ${{github.workspace}}/**/*Web.csproj --output ${{input.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -f ${{inputs.dotnetVerison}} + diff --git a/.github/actions/update-semver/action.yml b/.github/actions/update-semver/action.yml index ef491516c1..ccaa23c812 100644 --- a/.github/actions/update-semver/action.yml +++ b/.github/actions/update-semver/action.yml @@ -15,7 +15,7 @@ outputs: informationalVersion: description: The assembly informational version for the build value: ${{ steps.version.outputs.GitVersion_InformationalVersion }} - nugetVersion: + semVer: description: The NuGet package version for the build value: ${{ steps.version.outputs.GitVersion_SemVer }} majorMinorPatch: diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index fdb4fe807d..72cf238612 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -20,6 +20,7 @@ env: connectedServiceName: Microsoft Health Open Source Subscription composeLocation: build/docker/docker-compose.yaml imageTag: ${{github.run_number}} + outputPath: ${{github.workspace}}/artifacts jobs: setup: @@ -33,6 +34,7 @@ jobs: fileVersion: ${{ steps.version.outputs.fileVersion }} informationalVersion: ${{ steps.version.outputs.informationalVersion }} majorMinorPatch: ${{ steps.version.outputs.majorMinorPatch }} + semVer: ${{steps.version.outputs.SemVer}} steps: - name: Checkout uses: actions/checkout@v4 @@ -64,6 +66,7 @@ jobs: strategy: matrix: dotnet-version: [ '8.0.x', '6.0.x' ] + fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] steps: - name: Checkout uses: actions/checkout@v4 @@ -84,17 +87,27 @@ jobs: informationalVersion: ${{needs.setup.outputs.informationalVersion}} dotnetVersion: ${{matrix.dotnet-version}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - buildOutput: ${{github.workspace}}/artifacts + + - name: Package Web Build Artifacts + uses: ./.github/actions/package-web-build-artifacts + with: + fhirschemaversion: ${{ matrix.fhirSchemaVersion }} + majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + outputPath: ${{env.outputPath}} + buildConfiguration: ${{env.buildConfiguration}} + dotnetVersion: ${{matrix.dotnet-version}} + semVer: ${{needs.setup.outputs.semVer}} + - name: Generate SBOM run: | curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64 chmod +x $RUNNER_TEMP/sbom-tool - $RUNNER_TEMP/sbom-tool generate -b ./buildOutput -bc . -V Verbose + $RUNNER_TEMP/sbom-tool generate -b ./artifacts -bc . -V Verbose - name: Upload a Build Artifact uses: actions/upload-artifact@v4 with: - path: buildOutput + path: ${{env.outputPath}} runIntegrationTests: runs-on: ubuntu-latest From 5b8ee3a07a5789264e546240d7b1bbec3509bb6d Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 11:12:29 -0700 Subject: [PATCH 056/149] Attempting to parse dotnet version --- .github/actions/dotnet-build/action.yml | 51 +++++++------------------ 1 file changed, 13 insertions(+), 38 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 34c9fc0b42..f6566df02b 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -32,46 +32,21 @@ runs: shell: bash run: dotnet restore + - name: Convert version + id: convert_version + shell: bash + run: | + version=${${{inputs.dotnetVerison}}%%.*} + netVersion="net${version}.0" + echo "$netVersion" + echo "::set-output name=net_version::$netVersion" + env: + VERSION: ${{ steps.get_version.outputs.version }} + - name: Build shell: bash - run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build --targetFrameworkVersion ${{inputs.dotnetVersion}} --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror - name: Test shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" --filter "FullyQualifiedName\~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal - - # - name: Publish Artifacts - # shell: bash - # run: dotnet publish "Microsoft.Health.Fhir.sln" --output $(Build.ArtifactStagingDirectory)/web --configuration ${{inputs.buildConfiguration}} --no-build -f $(defaultBuildFramework) - # - name: Pack nugets - # shell: bash - # run: dotnet pack "Microsoft.Health.Fhir.sln" --output $(Build.ArtifactStagingDirectory)/nupkgs --no-build --configuration=Release -p:PackageVersion=${{inputs.nugetVersion}} - #Try pack command here to see if it picks up both framework outputs. It may not without referencing output of each job - # - 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' - # - run: mkdir -p coverage - # shell: bash - # - run: mkdir -p artifacts - # shell: bash - # - name: actions/upload-artifact - # uses: actions/upload-artifact@v4 - # with: - # name: fhirBuild-${{inputs.dotnetVersion}} - # path: artifacts - # retention-days: 1 - # - name: Upload Code Coverage Results - # uses: actions/upload-artifact@v4 - # with: - # name: fhirBuild-${{inputs.dotnetVersion}} - # path: artifacts - # retention-days: 1 + run: dotnet test "Microsoft.Health.Fhir.sln" --targetFrameworkVersion ${{inputs.dotnetVersion}} --filter "FullyQualifiedName\~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal From 48e51370f0b10f5cf40a0cefdeef7bf9f0e77a9a Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 11:37:04 -0700 Subject: [PATCH 057/149] Added conversion for dotnet version to use in build --- .github/actions/dotnet-build/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index f6566df02b..d64f137211 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -36,17 +36,17 @@ runs: id: convert_version shell: bash run: | - version=${${{inputs.dotnetVerison}}%%.*} + version=${VERSION%%.*} netVersion="net${version}.0" echo "$netVersion" echo "::set-output name=net_version::$netVersion" env: - VERSION: ${{ steps.get_version.outputs.version }} + VERSION: ${{ inputs.dotnet-version }} - name: Build shell: bash - run: dotnet build --targetFrameworkVersion ${{inputs.dotnetVersion}} --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build --targetFrameworkVersion ${{steps.convert_version.outputs.net_version}} --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror - name: Test shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" --targetFrameworkVersion ${{inputs.dotnetVersion}} --filter "FullyQualifiedName\~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" --targetFrameworkVersion ${{steps.convert_version.outputs.net_version}} --filter "FullyQualifiedName\~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal From d660afb3824a2fa9a269b9559d5a109a597734af Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 11:48:00 -0700 Subject: [PATCH 058/149] Variable reference fix --- .github/actions/dotnet-build/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index d64f137211..d9c022d67b 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -36,10 +36,10 @@ runs: id: convert_version shell: bash run: | - version=${VERSION%%.*} + version=${env.VERSION%%.*} netVersion="net${version}.0" echo "$netVersion" - echo "::set-output name=net_version::$netVersion" + echo "net_version=$netVersion >> $GITHUB_OUTPUT" env: VERSION: ${{ inputs.dotnet-version }} From 340b69f8e9acf9b3756a97de817709b2a80fcb4e Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 12:01:38 -0700 Subject: [PATCH 059/149] Fixing reference --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index d9c022d67b..8bf1f11510 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -36,7 +36,7 @@ runs: id: convert_version shell: bash run: | - version=${env.VERSION%%.*} + version=${{env.VERSION}}%%.* netVersion="net${version}.0" echo "$netVersion" echo "net_version=$netVersion >> $GITHUB_OUTPUT" From 6037a1696479930f8a3459debdaf78bff6b27dfa Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 12:08:48 -0700 Subject: [PATCH 060/149] Variable fixing --- .github/actions/dotnet-build/action.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 8bf1f11510..8bc4e858cd 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -36,12 +36,10 @@ runs: id: convert_version shell: bash run: | - version=${{env.VERSION}}%%.* + version=${{inputs.dotnetVerison}}%%.* netVersion="net${version}.0" echo "$netVersion" echo "net_version=$netVersion >> $GITHUB_OUTPUT" - env: - VERSION: ${{ inputs.dotnet-version }} - name: Build shell: bash From 2f4445dcd2a8e6dc3dbb36b275e4d016091f36ab Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 12:25:48 -0700 Subject: [PATCH 061/149] Trying another approach --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 8bc4e858cd..0c10da7122 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -36,7 +36,7 @@ runs: id: convert_version shell: bash run: | - version=${{inputs.dotnetVerison}}%%.* + version=$( echo "${{inputs.dotnetVerison}}" | sed '^.*?(?=\.)') netVersion="net${version}.0" echo "$netVersion" echo "net_version=$netVersion >> $GITHUB_OUTPUT" From 6d3ab837ab0abd2736fac5dfefe0da6c6db102ea Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 12:37:25 -0700 Subject: [PATCH 062/149] Variable still not showing up in bash command --- .github/actions/dotnet-build/action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 0c10da7122..95d4a35d9f 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -36,10 +36,11 @@ runs: id: convert_version shell: bash run: | - version=$( echo "${{inputs.dotnetVerison}}" | sed '^.*?(?=\.)') + dotnetVersion=${{inputs.dotnetVersion}} + version=$( echo "dotnetVersion" | sed '^.*?(?=\.)') netVersion="net${version}.0" echo "$netVersion" - echo "net_version=$netVersion >> $GITHUB_OUTPUT" + echo "net_version=$netVersion" >> "$GITHUB_OUTPUT" - name: Build shell: bash From 896d8afcfcf8da50a58b770c4a0cda8c60453f13 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 12:43:01 -0700 Subject: [PATCH 063/149] Closer --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 95d4a35d9f..40807cbcfb 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -37,7 +37,7 @@ runs: shell: bash run: | dotnetVersion=${{inputs.dotnetVersion}} - version=$( echo "dotnetVersion" | sed '^.*?(?=\.)') + version=$( echo "{dotnetVersion}" | sed '^.*?(?=\.)') netVersion="net${version}.0" echo "$netVersion" echo "net_version=$netVersion" >> "$GITHUB_OUTPUT" From 9d7a12694e9ca4fd4d89e74033b04978d574ed7c Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 12:51:18 -0700 Subject: [PATCH 064/149] Syntax --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 40807cbcfb..0c4f6331ad 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -37,7 +37,7 @@ runs: shell: bash run: | dotnetVersion=${{inputs.dotnetVersion}} - version=$( echo "{dotnetVersion}" | sed '^.*?(?=\.)') + version=$( echo "$dotnetVersion" | sed '^.*?(?=\.)') netVersion="net${version}.0" echo "$netVersion" echo "net_version=$netVersion" >> "$GITHUB_OUTPUT" From 06a3926add09e17ed1b34f6baeda0e9d0e880e00 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 13:22:50 -0700 Subject: [PATCH 065/149] Removing quotes --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 0c4f6331ad..8f439bd1f8 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -37,7 +37,7 @@ runs: shell: bash run: | dotnetVersion=${{inputs.dotnetVersion}} - version=$( echo "$dotnetVersion" | sed '^.*?(?=\.)') + version=$( echo $dotnetVersion | sed '^.*?(?=\.)') netVersion="net${version}.0" echo "$netVersion" echo "net_version=$netVersion" >> "$GITHUB_OUTPUT" From 00a0f27d1c2a9ca93d55c8b9c566ef706da5edd8 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 13:30:05 -0700 Subject: [PATCH 066/149] working on bash command --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 8f439bd1f8..3f77531483 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -37,7 +37,7 @@ runs: shell: bash run: | dotnetVersion=${{inputs.dotnetVersion}} - version=$( echo $dotnetVersion | sed '^.*?(?=\.)') + version=$( echo "$dotnetVersion" | sed 's/^.*?(?=\.)') netVersion="net${version}.0" echo "$netVersion" echo "net_version=$netVersion" >> "$GITHUB_OUTPUT" From bfa63a5a56bbf6ef30512f3dd7a4685b7f3b2325 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 13:55:10 -0700 Subject: [PATCH 067/149] Updated regex --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 3f77531483..b05f5d9b82 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -37,7 +37,7 @@ runs: shell: bash run: | dotnetVersion=${{inputs.dotnetVersion}} - version=$( echo "$dotnetVersion" | sed 's/^.*?(?=\.)') + version=$( echo "$dotnetVersion" | sed 's/^\([0-9]*\)\..*/\1/') netVersion="net${version}.0" echo "$netVersion" echo "net_version=$netVersion" >> "$GITHUB_OUTPUT" From 102d8af5eafe0df5aad160b659f81ee0e08db9ca Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 14:08:25 -0700 Subject: [PATCH 068/149] Updated build and test property --- .github/actions/dotnet-build/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index b05f5d9b82..ae6c983de9 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -44,8 +44,8 @@ runs: - name: Build shell: bash - run: dotnet build --targetFrameworkVersion ${{steps.convert_version.outputs.net_version}} --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build -f ${{steps.convert_version.outputs.net_version}} --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror - name: Test shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" --targetFrameworkVersion ${{steps.convert_version.outputs.net_version}} --filter "FullyQualifiedName\~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" -f ${{steps.convert_version.outputs.net_version}} --filter "FullyQualifiedName\~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal From deb2239226e68ddf862abe60f809c11ba474e69e Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 14:24:19 -0700 Subject: [PATCH 069/149] Misspelled property --- .github/actions/package-web-build-artifacts/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index 5ba3d07712..8dd882ea12 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -26,10 +26,10 @@ runs: shell: bash run: | echo "Creating Nuget packages for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet pack ${{github.workspace}} --output ${{input.outputPath}}/nupkgs --no-build --configuration=${{inputs.buildConfiguration}} -p:PackageVersion=${{inputs.majorMinorPatch}} + dotnet pack ${{github.workspace}} --output ${{inputs.outputPath}}/nupkgs --no-build --configuration=${{inputs.buildConfiguration}} -p:PackageVersion=${{inputs.majorMinorPatch}} - name: Package Web Artifacts shell: bash run: | echo "Packaging web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet publish ${{github.workspace}}/**/*Web.csproj --output ${{input.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -f ${{inputs.dotnetVerison}} + dotnet publish ${{github.workspace}}/**/*Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -f ${{inputs.dotnetVerison}} From 311bb1315d88d851bc6f790c347d09ba91b1b9ac Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 14:50:08 -0700 Subject: [PATCH 070/149] Splitting packaging off to separate job so we don't create more than two build jobs. More than that causes too many file locks --- .github/workflows/fhir-oss-ci-pipeline.yml | 34 +++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 72cf238612..7be4e7254c 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -66,7 +66,6 @@ jobs: strategy: matrix: dotnet-version: [ '8.0.x', '6.0.x' ] - fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] steps: - name: Checkout uses: actions/checkout@v4 @@ -88,16 +87,6 @@ jobs: dotnetVersion: ${{matrix.dotnet-version}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - - name: Package Web Build Artifacts - uses: ./.github/actions/package-web-build-artifacts - with: - fhirschemaversion: ${{ matrix.fhirSchemaVersion }} - majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - outputPath: ${{env.outputPath}} - buildConfiguration: ${{env.buildConfiguration}} - dotnetVersion: ${{matrix.dotnet-version}} - semVer: ${{needs.setup.outputs.semVer}} - - name: Generate SBOM run: | curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64 @@ -108,7 +97,27 @@ jobs: uses: actions/upload-artifact@v4 with: path: ${{env.outputPath}} - + packageBuildArtifacts: + runs-on: ubuntu-latest + needs: buildAndUnitTest + strategy: + matrix: + dotnet-version: [ '8.0.x', '6.0.x' ] + fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] + steps: + - name: Download Build Artifacts from Job Cache + uses: actions/download-artifact@v4 + with: + path: artifacts + - name: Package Web Build Artifacts + uses: ./.github/actions/package-web-build-artifacts + with: + fhirschemaversion: ${{ matrix.fhirSchemaVersion }} + majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + outputPath: ${{env.outputPath}} + buildConfiguration: ${{env.buildConfiguration}} + dotnetVersion: ${{matrix.dotnet-version}} + semVer: ${{needs.setup.outputs.semVer}} runIntegrationTests: runs-on: ubuntu-latest needs : buildAndUnitTest @@ -116,5 +125,4 @@ jobs: - name: Download Build Artifact for Testing uses: actions/download-artifact@v4 with: - name: fhirBuild-8.0.x path: artifacts From e1366bf89ad88f25f1b7bb3bfe6bda402693f3c4 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 25 Mar 2024 15:15:01 -0700 Subject: [PATCH 071/149] Removing escape character --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index ae6c983de9..4e159e6a4a 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -48,4 +48,4 @@ runs: - name: Test shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" -f ${{steps.convert_version.outputs.net_version}} --filter "FullyQualifiedName\~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" -f ${{steps.convert_version.outputs.net_version}} --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal From 8a2f5264865c971cdfb6d17c981f93b4b97c0977 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 26 Mar 2024 09:38:13 -0700 Subject: [PATCH 072/149] Added condition to only run test if matrix is dotnet 8 so we don't duplicate test runs. --- .github/actions/dotnet-build/action.yml | 4 ---- .github/actions/dotnet-test/action.yml | 16 ++++++++++++++++ .github/workflows/fhir-oss-ci-pipeline.yml | 5 +++++ 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 .github/actions/dotnet-test/action.yml diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 4e159e6a4a..ab87d9d56f 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -45,7 +45,3 @@ runs: - name: Build shell: bash run: dotnet build -f ${{steps.convert_version.outputs.net_version}} --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror - - - name: Test - shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" -f ${{steps.convert_version.outputs.net_version}} --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal diff --git a/.github/actions/dotnet-test/action.yml b/.github/actions/dotnet-test/action.yml new file mode 100644 index 0000000000..5ecf9b3cc5 --- /dev/null +++ b/.github/actions/dotnet-test/action.yml @@ -0,0 +1,16 @@ +name: dotnet test +description: 'Runs the unit tests for the Fhir solution' +inputs: + buildConfiguration: + description: 'The build configuration to use' + required: true + dotnetVersion: + description: 'The version of dotnet to use' + default: net8.0 + required: true +runs: + using: 'composite' + steps: + - name: Run Unit Tests + shell: bash + run: dotnet test "Microsoft.Health.Fhir.sln" -f ${{inputs.dotnetVersion}} --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 7be4e7254c..6a3981de7c 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -86,6 +86,11 @@ jobs: informationalVersion: ${{needs.setup.outputs.informationalVersion}} dotnetVersion: ${{matrix.dotnet-version}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + - name: Test + uses: ./.github/actions/dotnet-test + if: ${{ matrix.dotnet-version == '8.0.x' }} + with: + buildConfiguration: ${{env.buildConfiguration}} - name: Generate SBOM run: | From 401fad124da99b45b4677ba996db8a144f5703fa Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 26 Mar 2024 10:40:53 -0700 Subject: [PATCH 073/149] Updated SBOM path --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 6a3981de7c..2447e6c7d5 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -96,7 +96,7 @@ jobs: run: | curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64 chmod +x $RUNNER_TEMP/sbom-tool - $RUNNER_TEMP/sbom-tool generate -b ./artifacts -bc . -V Verbose + $RUNNER_TEMP/sbom-tool generate -b . -bc . -V Verbose - name: Upload a Build Artifact uses: actions/upload-artifact@v4 From 88518d320593851cff91bf9284361717aa2ae951 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 26 Mar 2024 12:19:23 -0700 Subject: [PATCH 074/149] Required package supplier --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 2447e6c7d5..2a2f48918c 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -96,7 +96,7 @@ jobs: run: | curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64 chmod +x $RUNNER_TEMP/sbom-tool - $RUNNER_TEMP/sbom-tool generate -b . -bc . -V Verbose + $RUNNER_TEMP/sbom-tool generate -b . -bc . -V Verbose -ps "Organization: Microsoft" - name: Upload a Build Artifact uses: actions/upload-artifact@v4 From 9a1a946baf9e2edc9d3415f66be6c2d3e9b37c8a Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 26 Mar 2024 12:34:03 -0700 Subject: [PATCH 075/149] Added package name and version to SboM --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 2a2f48918c..e1176da3ab 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -96,7 +96,7 @@ jobs: run: | curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64 chmod +x $RUNNER_TEMP/sbom-tool - $RUNNER_TEMP/sbom-tool generate -b . -bc . -V Verbose -ps "Organization: Microsoft" + $RUNNER_TEMP/sbom-tool generate -b . -bc . -V Verbose -ps "Organization: Microsoft" -pv ${{needs.setup.outputs.majorMinorPatch}} -pn ${{needs.setup.outputs.informationalVersion}} - name: Upload a Build Artifact uses: actions/upload-artifact@v4 From 3c851b5c45e0ec19559578c796b27bbb514cee70 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 27 Mar 2024 10:02:17 -0700 Subject: [PATCH 076/149] Trying with just one dotnet version to see if badimageformatexception still shows up. --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index e1176da3ab..0cfeb55479 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -65,7 +65,7 @@ jobs: needs: setup strategy: matrix: - dotnet-version: [ '8.0.x', '6.0.x' ] + dotnet-version: [ '8.0.x'] steps: - name: Checkout uses: actions/checkout@v4 From bbf341dccc33a9f21753864245dc43d561e33cea Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 27 Mar 2024 10:28:25 -0700 Subject: [PATCH 077/149] Removing additional restore during build --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index ab87d9d56f..55b797b4b6 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -44,4 +44,4 @@ runs: - name: Build shell: bash - run: dotnet build -f ${{steps.convert_version.outputs.net_version}} --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build -f ${{steps.convert_version.outputs.net_version}} --no-restore --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror From a5338c9fcfe8f70607204d7d55f170af88515fb8 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 27 Mar 2024 13:49:33 -0700 Subject: [PATCH 078/149] Simplifying build and test --- .github/actions/dotnet-build/action.yml | 24 +--------------------- .github/actions/dotnet-test/action.yml | 6 +----- .github/workflows/fhir-oss-ci-pipeline.yml | 17 ++++++++------- 3 files changed, 12 insertions(+), 35 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 55b797b4b6..4adc3f4bca 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -14,34 +14,12 @@ inputs: informationalVersion: description: The scaler assembly's informational version. required: true - dotnetVersion: - description: The version of dotnet to use. - required: true majorMinorPatch: description: The major.minor.patch version to use. required: true runs: using: composite steps: - - name: Setup dotnet ${{ inputs.dotnetVersion }} - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ inputs.dotnetVersion}} - - - name: Restore Dependencies - shell: bash - run: dotnet restore - - - name: Convert version - id: convert_version - shell: bash - run: | - dotnetVersion=${{inputs.dotnetVersion}} - version=$( echo "$dotnetVersion" | sed 's/^\([0-9]*\)\..*/\1/') - netVersion="net${version}.0" - echo "$netVersion" - echo "net_version=$netVersion" >> "$GITHUB_OUTPUT" - - name: Build shell: bash - run: dotnet build -f ${{steps.convert_version.outputs.net_version}} --no-restore --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror diff --git a/.github/actions/dotnet-test/action.yml b/.github/actions/dotnet-test/action.yml index 5ecf9b3cc5..e15a750bb4 100644 --- a/.github/actions/dotnet-test/action.yml +++ b/.github/actions/dotnet-test/action.yml @@ -4,13 +4,9 @@ inputs: buildConfiguration: description: 'The build configuration to use' required: true - dotnetVersion: - description: 'The version of dotnet to use' - default: net8.0 - required: true runs: using: 'composite' steps: - name: Run Unit Tests shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" -f ${{inputs.dotnetVersion}} --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 0cfeb55479..1e9397890c 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -43,6 +43,11 @@ jobs: - name: Install Latest .Net SDK uses: actions/setup-dotnet@v4 + with: + global-json-file: 'global.json' + dotnet-version: | + 6.x + 8.x - name: Determine Semver id: version @@ -63,19 +68,19 @@ jobs: buildAndUnitTest: runs-on: ubuntu-latest needs: setup - strategy: - matrix: - dotnet-version: [ '8.0.x'] steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup dotnet ${{ matrix.dotnet-version }} + - name: Install Latest .Net SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: ${{ matrix.dotnet-version }} + global-json-file: 'global.json' + dotnet-version: | + 6.x + 8.x - name: Build uses: ./.github/actions/dotnet-build @@ -84,11 +89,9 @@ jobs: buildConfiguration: ${{env.buildConfiguration}} fileVersion: ${{needs.setup.outputs.fileVersion}} informationalVersion: ${{needs.setup.outputs.informationalVersion}} - dotnetVersion: ${{matrix.dotnet-version}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - name: Test uses: ./.github/actions/dotnet-test - if: ${{ matrix.dotnet-version == '8.0.x' }} with: buildConfiguration: ${{env.buildConfiguration}} From 89ea79099dce348c8ff93e41f919c6e0132afc37 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 27 Mar 2024 16:42:14 -0700 Subject: [PATCH 079/149] Trying with 3.1 installed --- .github/workflows/fhir-oss-ci-pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 1e9397890c..35800463e0 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -81,6 +81,7 @@ jobs: dotnet-version: | 6.x 8.x + 3.1 - name: Build uses: ./.github/actions/dotnet-build From 76996b863b52322bacbdc8a49788c5b4bf7a7278 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 28 Mar 2024 11:58:57 -0700 Subject: [PATCH 080/149] Temporarily commenting out unit tests until I can rest of pipeline working. --- .../package-web-build-artifacts/action.yml | 5 +--- .github/workflows/fhir-oss-ci-pipeline.yml | 26 +++++++++---------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index 8dd882ea12..5b7d88f85d 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -13,9 +13,6 @@ inputs: buildConfiguration: description: 'The build configuration to use' required: true - dotnetVerison: - description: 'The version of dotnet to use' - required: true semVer: description: 'The SemVer to use' required: true @@ -31,5 +28,5 @@ runs: shell: bash run: | echo "Packaging web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet publish ${{github.workspace}}/**/*Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -f ${{inputs.dotnetVerison}} + dotnet publish ${{github.workspace}}/**/*Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 35800463e0..d05b91e8e2 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -91,10 +91,10 @@ jobs: fileVersion: ${{needs.setup.outputs.fileVersion}} informationalVersion: ${{needs.setup.outputs.informationalVersion}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - - name: Test - uses: ./.github/actions/dotnet-test - with: - buildConfiguration: ${{env.buildConfiguration}} + # - name: Test + # uses: ./.github/actions/dotnet-test + # with: + # buildConfiguration: ${{env.buildConfiguration}} - name: Generate SBOM run: | @@ -111,7 +111,6 @@ jobs: needs: buildAndUnitTest strategy: matrix: - dotnet-version: [ '8.0.x', '6.0.x' ] fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] steps: - name: Download Build Artifacts from Job Cache @@ -125,13 +124,12 @@ jobs: majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} outputPath: ${{env.outputPath}} buildConfiguration: ${{env.buildConfiguration}} - dotnetVersion: ${{matrix.dotnet-version}} semVer: ${{needs.setup.outputs.semVer}} - runIntegrationTests: - runs-on: ubuntu-latest - needs : buildAndUnitTest - steps: - - name: Download Build Artifact for Testing - uses: actions/download-artifact@v4 - with: - path: artifacts + # runIntegrationTests: + # runs-on: ubuntu-latest + # needs : buildAndUnitTest + # steps: + # - name: Download Build Artifact for Testing + # uses: actions/download-artifact@v4 + # with: + # path: artifacts From c6c705c8eddc14c13da0f76ea4aada1da4b70bc5 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 08:57:02 -0700 Subject: [PATCH 081/149] Added checkout command before running package --- .github/workflows/fhir-oss-ci-pipeline.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index d05b91e8e2..f2675a42df 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -113,6 +113,10 @@ jobs: matrix: fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Download Build Artifacts from Job Cache uses: actions/download-artifact@v4 with: From ee9866ccbab5046664f6d6c4354b2d19ddf62f4d Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 09:40:38 -0700 Subject: [PATCH 082/149] Added explicit restore for nuget packages --- .github/workflows/fhir-oss-ci-pipeline.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index f2675a42df..ca508af809 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -81,7 +81,6 @@ jobs: dotnet-version: | 6.x 8.x - 3.1 - name: Build uses: ./.github/actions/dotnet-build @@ -117,10 +116,20 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Install Latest .Net SDK + uses: actions/setup-dotnet@v4 + with: + global-json-file: 'global.json' + dotnet-version: | + 6.x + 8.x - name: Download Build Artifacts from Job Cache uses: actions/download-artifact@v4 with: path: artifacts + - name: Nuget Restore + shell: bash + run: dotnet restore - name: Package Web Build Artifacts uses: ./.github/actions/package-web-build-artifacts with: From 5148fa05697580034d5f01c4fabd40742b619de7 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 09:56:49 -0700 Subject: [PATCH 083/149] Moved restore to before the artifacts pull --- .github/workflows/fhir-oss-ci-pipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index ca508af809..2e8def0c50 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -123,13 +123,13 @@ jobs: dotnet-version: | 6.x 8.x + - name: Nuget Restore + shell: bash + run: dotnet restore - name: Download Build Artifacts from Job Cache uses: actions/download-artifact@v4 with: path: artifacts - - name: Nuget Restore - shell: bash - run: dotnet restore - name: Package Web Build Artifacts uses: ./.github/actions/package-web-build-artifacts with: From 3b9bc2856e08da61680e7b8ca32616540babff16 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 10:52:08 -0700 Subject: [PATCH 084/149] Added sln to restore call --- .github/actions/docker-build/action.yml | 25 ++++++++++++++++++++++ .github/workflows/fhir-oss-ci-pipeline.yml | 21 ++++++++++++------ 2 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 .github/actions/docker-build/action.yml diff --git a/.github/actions/docker-build/action.yml b/.github/actions/docker-build/action.yml new file mode 100644 index 0000000000..5e66230270 --- /dev/null +++ b/.github/actions/docker-build/action.yml @@ -0,0 +1,25 @@ +name: Docker Build +description: 'Builds images for all supported FHIR versions' + +inputs: + tag: + description: 'The tag to apply to the images' + required: true + fhirSchemaVersion: + description: 'The FHIR schema version to package' + required: true + assemblyVersion: + description: 'The assembly version to use' + required: true + composeLocation: + description: 'The location of the docker-compose file' + required: true + +runs: + using: 'composite' + steps: + - name: Build and Push Docker Images + shell: bash + run: | + echo "Building and pushing Docker images for FHIR schema version ${{inputs.fhirSchemaVersion}}" + docker-compose -f ${{inputs.composeLocation}} build -p ${{inputs.fhirSchemaVersion}} --build-arg FHIR_VERSION=${{inputs.fhirSchemaVersion}} --build-arg ASSEMBLY_VER=${{inputs.assemblyVersion}} diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 2e8def0c50..9d9b49efcc 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -65,6 +65,10 @@ jobs: uses: ./.github/actions/clean-storage-accounts with: environmentName: ${{vars.CIRESOURCEGROUPROOT}} + # - name: Cleanup Integration Test databases + # uses: ./.github/actions/cleanup-integration-test-databases + # with: + # environmentName: ${{vars.CIRESOURCEGROUPROOT}} buildAndUnitTest: runs-on: ubuntu-latest needs: setup @@ -95,11 +99,16 @@ jobs: # with: # buildConfiguration: ${{env.buildConfiguration}} - - name: Generate SBOM - run: | - curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64 - chmod +x $RUNNER_TEMP/sbom-tool - $RUNNER_TEMP/sbom-tool generate -b . -bc . -V Verbose -ps "Organization: Microsoft" -pv ${{needs.setup.outputs.majorMinorPatch}} -pn ${{needs.setup.outputs.informationalVersion}} + # - name: Generate SBOM + # run: | + # curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64 + # chmod +x $RUNNER_TEMP/sbom-tool + # $RUNNER_TEMP/sbom-tool generate -b . -bc . -V Verbose -ps "Organization: Microsoft" -pv ${{needs.setup.outputs.majorMinorPatch}} -pn ${{needs.setup.outputs.informationalVersion}} + + # - name: Docker Build + # uses: ./.github/actions/docker-build + # with: + # assemblySemFileVer: ${{needs.setup.outputs.semVer}} - name: Upload a Build Artifact uses: actions/upload-artifact@v4 @@ -125,7 +134,7 @@ jobs: 8.x - name: Nuget Restore shell: bash - run: dotnet restore + run: dotnet restore Microsoft.Health.Fhir.sln - name: Download Build Artifacts from Job Cache uses: actions/download-artifact@v4 with: From f3680f3cd638361fd6ed2c42261a27e479f3e4ea Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 11:13:50 -0700 Subject: [PATCH 085/149] Updating action to v2 --- .github/actions/clean-storage-accounts/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/clean-storage-accounts/action.yml b/.github/actions/clean-storage-accounts/action.yml index 2b91090852..35df072a4c 100644 --- a/.github/actions/clean-storage-accounts/action.yml +++ b/.github/actions/clean-storage-accounts/action.yml @@ -10,7 +10,7 @@ runs: using: 'composite' steps: - name: Clean Storage Accounts - uses: azure/powershell@v1 + uses: azure/powershell@v2 with: azPSVersion: "latest" inlineScript: | From ca5701fd41212658736ea61bc7bf997eb1f7b233 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 11:44:32 -0700 Subject: [PATCH 086/149] dotnet restore update --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 9d9b49efcc..118a9b1178 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -134,7 +134,7 @@ jobs: 8.x - name: Nuget Restore shell: bash - run: dotnet restore Microsoft.Health.Fhir.sln + run: dotnet restore ./Microsoft.Health.Fhir.sln - name: Download Build Artifacts from Job Cache uses: actions/download-artifact@v4 with: From 3f824014e6939d7f040d72d092f21d4fa7cab3a5 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 12:25:07 -0700 Subject: [PATCH 087/149] Debugging restore --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 118a9b1178..73bc5b8473 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -134,7 +134,7 @@ jobs: 8.x - name: Nuget Restore shell: bash - run: dotnet restore ./Microsoft.Health.Fhir.sln + run: dotnet restore --verbosity detailed - name: Download Build Artifacts from Job Cache uses: actions/download-artifact@v4 with: From 027772f62fa2d7babe37737d8c9b7ae172ae6a70 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 14:02:47 -0700 Subject: [PATCH 088/149] Added working path --- .github/actions/docker-add-tag/action.yml | 36 ++++++++++++++++++++++ .github/workflows/fhir-oss-ci-pipeline.yml | 28 ++++++++++++++--- 2 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 .github/actions/docker-add-tag/action.yml diff --git a/.github/actions/docker-add-tag/action.yml b/.github/actions/docker-add-tag/action.yml new file mode 100644 index 0000000000..68d89b1835 --- /dev/null +++ b/.github/actions/docker-add-tag/action.yml @@ -0,0 +1,36 @@ +name: Docker Add Main tag +description: 'Adds the main tag to the images for all supported FHIR versions' + +inputs: + sourceTag: + description: 'The tag to apply to the images' + required: true + targetTag: + description: 'The tag to apply to the images' + required: true + fhirSchemaVersion: + description: 'The FHIR schema version to package' + required: true + azureContainerRegistry: + description: 'The Azure Container Registry to push the images to' + required: true + +runs: + using: 'composite' + steps: + - name: Azure Login + uses: azure/login@v2 + with: + client-id: ${{secrets.AZURE_CLIENT_ID}} + subscription-id: ${{secrets.AZURE_SUBSCRIPTION_ID}} + tenant-id: ${{secrets.AZURE_TENANT_ID}} + enable-AzPSSession: true + - name: Add Tag to Docker Images + shell: bash + run: | + az acr login -n ${{inputs.azureContainerRegistry}} + sourceImage="${{inputs.azureContainerRegistry}}/${{inputs.fhirSchemaVersion}}_fhir-server:${{inputs.sourceTag}}" + targetImage="${{inputs.azureContainerRegistry}}/${{inputs.fhirSchemaVersion}}_fhir-server:${{inputs.targetTag}}" + docker pull $sourceImage + docker tag $sourceImage $targetImage + docker push $targetImage diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 73bc5b8473..ca4adcc8dc 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -105,11 +105,6 @@ jobs: # chmod +x $RUNNER_TEMP/sbom-tool # $RUNNER_TEMP/sbom-tool generate -b . -bc . -V Verbose -ps "Organization: Microsoft" -pv ${{needs.setup.outputs.majorMinorPatch}} -pn ${{needs.setup.outputs.informationalVersion}} - # - name: Docker Build - # uses: ./.github/actions/docker-build - # with: - # assemblySemFileVer: ${{needs.setup.outputs.semVer}} - - name: Upload a Build Artifact uses: actions/upload-artifact@v4 with: @@ -133,6 +128,7 @@ jobs: 6.x 8.x - name: Nuget Restore + working-directory: ${{github.workspace}}/fhirserver/fhirserver shell: bash run: dotnet restore --verbosity detailed - name: Download Build Artifacts from Job Cache @@ -147,11 +143,33 @@ jobs: outputPath: ${{env.outputPath}} buildConfiguration: ${{env.buildConfiguration}} semVer: ${{needs.setup.outputs.semVer}} + # - name: Docker Build + # uses: ./.github/actions/docker-build + # with: + # assemblySemFileVer: ${{needs.setup.outputs.semVer}} # runIntegrationTests: # runs-on: ubuntu-latest # needs : buildAndUnitTest # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 # - name: Download Build Artifact for Testing # uses: actions/download-artifact@v4 # with: # path: artifacts + # - name: Install Latest .Net SDK + # uses: actions/setup-dotnet@v4 + # with: + # global-json-file: 'global.json' + # dotnet-version: | + # 6.x + # 8.x + # - name: Docker add main tag + # uses: ./.github/actions/docker-add-main-tag + # with: + # assemblySemFileVer: ${{needs.setup.outputs.semVer}} + # imageTag: ${{env.imageTag}} + # azureContainerRegistryName: ${{env.azureContainerRegistryName}} + # connectedServiceName: ${{env.connectedServiceName}} From 8ba73e41a3e6d6b14b907a43ebdcc1890159e4b7 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 14:16:11 -0700 Subject: [PATCH 089/149] Fixed working path --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index ca4adcc8dc..02bfb81f60 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -128,7 +128,7 @@ jobs: 6.x 8.x - name: Nuget Restore - working-directory: ${{github.workspace}}/fhirserver/fhirserver + working-directory: ${{github.workspace}}/fhirserver shell: bash run: dotnet restore --verbosity detailed - name: Download Build Artifacts from Job Cache From ba2f956dd54fc23e4c8ebb56d79c067e4eb531e7 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 14:40:29 -0700 Subject: [PATCH 090/149] path update --- .github/workflows/fhir-oss-ci-pipeline.yml | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 02bfb81f60..4e9d948f46 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -53,18 +53,18 @@ jobs: id: version uses: ./.github/actions/update-semver - - name: Azure Login - uses: azure/login@v2 - with: - client-id: ${{secrets.AZURE_CLIENT_ID}} - subscription-id: ${{secrets.AZURE_SUBSCRIPTION_ID}} - tenant-id: ${{secrets.AZURE_TENANT_ID}} - enable-AzPSSession: true + # - name: Azure Login + # uses: azure/login@v2 + # with: + # client-id: ${{secrets.AZURE_CLIENT_ID}} + # subscription-id: ${{secrets.AZURE_SUBSCRIPTION_ID}} + # tenant-id: ${{secrets.AZURE_TENANT_ID}} + # enable-AzPSSession: true - - name: Clean Storage Accounts - uses: ./.github/actions/clean-storage-accounts - with: - environmentName: ${{vars.CIRESOURCEGROUPROOT}} + # - name: Clean Storage Accounts + # uses: ./.github/actions/clean-storage-accounts + # with: + # environmentName: ${{vars.CIRESOURCEGROUPROOT}} # - name: Cleanup Integration Test databases # uses: ./.github/actions/cleanup-integration-test-databases # with: @@ -128,7 +128,7 @@ jobs: 6.x 8.x - name: Nuget Restore - working-directory: ${{github.workspace}}/fhirserver + working-directory: ${{github.workspace}} shell: bash run: dotnet restore --verbosity detailed - name: Download Build Artifacts from Job Cache From 297aab5716b0e052266ba3b149facb64278808a3 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 15:05:23 -0700 Subject: [PATCH 091/149] Added missing parameter --- .github/actions/package-web-build-artifacts/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index 5b7d88f85d..15a25d7f67 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -28,5 +28,5 @@ runs: shell: bash run: | echo "Packaging web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet publish ${{github.workspace}}/**/*Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build + dotnet publish ${{github.workspace}}/**/*Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} From 86d8890e0f9c129bc93e69e3c8a716c53466a39f Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 15:22:38 -0700 Subject: [PATCH 092/149] Added additional needs --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 4e9d948f46..a4ad7b1dad 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -111,7 +111,7 @@ jobs: path: ${{env.outputPath}} packageBuildArtifacts: runs-on: ubuntu-latest - needs: buildAndUnitTest + needs: [setup, buildAndUnitTest] strategy: matrix: fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] From 2f86d9283709d934f06e631ec1308af4acb0441f Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 15:36:11 -0700 Subject: [PATCH 093/149] Temp change to same job for build and package --- .github/workflows/fhir-oss-ci-pipeline.yml | 79 ++++++++++++---------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index a4ad7b1dad..0ae9e07819 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -72,6 +72,9 @@ jobs: buildAndUnitTest: runs-on: ubuntu-latest needs: setup + strategy: + matrix: + fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] steps: - name: Checkout uses: actions/checkout@v4 @@ -94,6 +97,14 @@ jobs: fileVersion: ${{needs.setup.outputs.fileVersion}} informationalVersion: ${{needs.setup.outputs.informationalVersion}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + - name: Package Web Build Artifacts + uses: ./.github/actions/package-web-build-artifacts + with: + fhirschemaversion: ${{ matrix.fhirSchemaVersion }} + majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + outputPath: ${{env.outputPath}} + buildConfiguration: ${{env.buildConfiguration}} + semVer: ${{needs.setup.outputs.semVer}} # - name: Test # uses: ./.github/actions/dotnet-test # with: @@ -109,40 +120,40 @@ jobs: uses: actions/upload-artifact@v4 with: path: ${{env.outputPath}} - packageBuildArtifacts: - runs-on: ubuntu-latest - needs: [setup, buildAndUnitTest] - strategy: - matrix: - fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install Latest .Net SDK - uses: actions/setup-dotnet@v4 - with: - global-json-file: 'global.json' - dotnet-version: | - 6.x - 8.x - - name: Nuget Restore - working-directory: ${{github.workspace}} - shell: bash - run: dotnet restore --verbosity detailed - - name: Download Build Artifacts from Job Cache - uses: actions/download-artifact@v4 - with: - path: artifacts - - name: Package Web Build Artifacts - uses: ./.github/actions/package-web-build-artifacts - with: - fhirschemaversion: ${{ matrix.fhirSchemaVersion }} - majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - outputPath: ${{env.outputPath}} - buildConfiguration: ${{env.buildConfiguration}} - semVer: ${{needs.setup.outputs.semVer}} + # packageBuildArtifacts: + # runs-on: ubuntu-latest + # needs: [setup, buildAndUnitTest] + # strategy: + # matrix: + # fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # - name: Install Latest .Net SDK + # uses: actions/setup-dotnet@v4 + # with: + # global-json-file: 'global.json' + # dotnet-version: | + # 6.x + # 8.x + # - name: Nuget Restore + # working-directory: ${{github.workspace}} + # shell: bash + # run: dotnet restore --verbosity detailed + # - name: Download Build Artifacts from Job Cache + # uses: actions/download-artifact@v4 + # with: + # path: artifacts + # - name: Package Web Build Artifacts + # uses: ./.github/actions/package-web-build-artifacts + # with: + # fhirschemaversion: ${{ matrix.fhirSchemaVersion }} + # majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + # outputPath: ${{env.outputPath}} + # buildConfiguration: ${{env.buildConfiguration}} + # semVer: ${{needs.setup.outputs.semVer}} # - name: Docker Build # uses: ./.github/actions/docker-build # with: From 8cb3d4282b734009d695e5256cc8781a34c6aa3e Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 1 Apr 2024 09:27:56 -0700 Subject: [PATCH 094/149] Put in explicit path for web projects --- .github/actions/package-web-build-artifacts/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index 15a25d7f67..0c66ad85e8 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -28,5 +28,5 @@ runs: shell: bash run: | echo "Packaging web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet publish ${{github.workspace}}/**/*Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} + dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} From 3ec269ad0eb32cd05ccaefa024c9a14608d6faef Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 1 Apr 2024 09:41:57 -0700 Subject: [PATCH 095/149] Explicit dotnet version package --- .../actions/package-web-build-artifacts/action.yml | 5 ++++- .github/workflows/fhir-oss-ci-pipeline.yml | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index 0c66ad85e8..fd6bbcc214 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -16,6 +16,9 @@ inputs: semVer: description: 'The SemVer to use' required: true + dotnetVersion: + description: 'The version of dotnet to use' + required: true runs: using: 'composite' steps: @@ -28,5 +31,5 @@ runs: shell: bash run: | echo "Packaging web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} + dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{inputs.dotnetVersion}} diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 0ae9e07819..bf3b292ef7 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -97,7 +97,7 @@ jobs: fileVersion: ${{needs.setup.outputs.fileVersion}} informationalVersion: ${{needs.setup.outputs.informationalVersion}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - - name: Package Web Build Artifacts + - name: Package Web Build Artifacts 6.x uses: ./.github/actions/package-web-build-artifacts with: fhirschemaversion: ${{ matrix.fhirSchemaVersion }} @@ -105,6 +105,16 @@ jobs: outputPath: ${{env.outputPath}} buildConfiguration: ${{env.buildConfiguration}} semVer: ${{needs.setup.outputs.semVer}} + dotnetVersion: 6.x + - name: Package Web Build Artifacts 8.x + uses: ./.github/actions/package-web-build-artifacts + with: + fhirschemaversion: ${{ matrix.fhirSchemaVersion }} + majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + outputPath: ${{env.outputPath}} + buildConfiguration: ${{env.buildConfiguration}} + semVer: ${{needs.setup.outputs.semVer}} + dotnetVersion: 8.x # - name: Test # uses: ./.github/actions/dotnet-test # with: From f70e55b81cabfca6ba06c5feedd1f3ed4d70a410 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 1 Apr 2024 10:18:53 -0700 Subject: [PATCH 096/149] Used wrong dotnet version modifiers --- .github/workflows/fhir-oss-ci-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index bf3b292ef7..9d1134783c 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -105,7 +105,7 @@ jobs: outputPath: ${{env.outputPath}} buildConfiguration: ${{env.buildConfiguration}} semVer: ${{needs.setup.outputs.semVer}} - dotnetVersion: 6.x + dotnetVersion: net6.0 - name: Package Web Build Artifacts 8.x uses: ./.github/actions/package-web-build-artifacts with: @@ -114,7 +114,7 @@ jobs: outputPath: ${{env.outputPath}} buildConfiguration: ${{env.buildConfiguration}} semVer: ${{needs.setup.outputs.semVer}} - dotnetVersion: 8.x + dotnetVersion: net8.0 # - name: Test # uses: ./.github/actions/dotnet-test # with: From b29fa14c327c66fc6a0fc1bf9903fd21b4352eec Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 1 Apr 2024 13:05:46 -0700 Subject: [PATCH 097/149] Updated web packaging to only target latest dotnet 8 --- .../actions/package-web-build-artifacts/action.yml | 5 +---- .github/workflows/fhir-oss-ci-pipeline.yml | 13 ++----------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index fd6bbcc214..1d8f4da74c 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -16,9 +16,6 @@ inputs: semVer: description: 'The SemVer to use' required: true - dotnetVersion: - description: 'The version of dotnet to use' - required: true runs: using: 'composite' steps: @@ -31,5 +28,5 @@ runs: shell: bash run: | echo "Packaging web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{inputs.dotnetVersion}} + dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 9d1134783c..614d1f31e0 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -21,6 +21,7 @@ env: composeLocation: build/docker/docker-compose.yaml imageTag: ${{github.run_number}} outputPath: ${{github.workspace}}/artifacts + defaultDotNetVersion: net8.0 jobs: setup: @@ -97,7 +98,7 @@ jobs: fileVersion: ${{needs.setup.outputs.fileVersion}} informationalVersion: ${{needs.setup.outputs.informationalVersion}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - - name: Package Web Build Artifacts 6.x + - name: Package Web Build Artifacts uses: ./.github/actions/package-web-build-artifacts with: fhirschemaversion: ${{ matrix.fhirSchemaVersion }} @@ -105,16 +106,6 @@ jobs: outputPath: ${{env.outputPath}} buildConfiguration: ${{env.buildConfiguration}} semVer: ${{needs.setup.outputs.semVer}} - dotnetVersion: net6.0 - - name: Package Web Build Artifacts 8.x - uses: ./.github/actions/package-web-build-artifacts - with: - fhirschemaversion: ${{ matrix.fhirSchemaVersion }} - majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - outputPath: ${{env.outputPath}} - buildConfiguration: ${{env.buildConfiguration}} - semVer: ${{needs.setup.outputs.semVer}} - dotnetVersion: net8.0 # - name: Test # uses: ./.github/actions/dotnet-test # with: From 5d33dee027303385a86f349976bb57b1dc6fe241 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 1 Apr 2024 13:42:17 -0700 Subject: [PATCH 098/149] Testing packaging back into its own job. --- .github/workflows/fhir-oss-ci-pipeline.yml | 76 ++++++++++------------ 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 614d1f31e0..36007e88eb 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -98,14 +98,6 @@ jobs: fileVersion: ${{needs.setup.outputs.fileVersion}} informationalVersion: ${{needs.setup.outputs.informationalVersion}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - - name: Package Web Build Artifacts - uses: ./.github/actions/package-web-build-artifacts - with: - fhirschemaversion: ${{ matrix.fhirSchemaVersion }} - majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - outputPath: ${{env.outputPath}} - buildConfiguration: ${{env.buildConfiguration}} - semVer: ${{needs.setup.outputs.semVer}} # - name: Test # uses: ./.github/actions/dotnet-test # with: @@ -121,40 +113,40 @@ jobs: uses: actions/upload-artifact@v4 with: path: ${{env.outputPath}} - # packageBuildArtifacts: - # runs-on: ubuntu-latest - # needs: [setup, buildAndUnitTest] - # strategy: - # matrix: - # fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # - name: Install Latest .Net SDK - # uses: actions/setup-dotnet@v4 - # with: - # global-json-file: 'global.json' - # dotnet-version: | - # 6.x - # 8.x - # - name: Nuget Restore - # working-directory: ${{github.workspace}} - # shell: bash - # run: dotnet restore --verbosity detailed - # - name: Download Build Artifacts from Job Cache - # uses: actions/download-artifact@v4 - # with: - # path: artifacts - # - name: Package Web Build Artifacts - # uses: ./.github/actions/package-web-build-artifacts - # with: - # fhirschemaversion: ${{ matrix.fhirSchemaVersion }} - # majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - # outputPath: ${{env.outputPath}} - # buildConfiguration: ${{env.buildConfiguration}} - # semVer: ${{needs.setup.outputs.semVer}} + packageBuildArtifacts: + runs-on: ubuntu-latest + needs: [setup, buildAndUnitTest] + strategy: + matrix: + fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Latest .Net SDK + uses: actions/setup-dotnet@v4 + with: + global-json-file: 'global.json' + dotnet-version: | + 6.x + 8.x + - name: Nuget Restore + working-directory: ${{github.workspace}} + shell: bash + run: dotnet restore --verbosity detailed + - name: Download Build Artifacts from Job Cache + uses: actions/download-artifact@v4 + with: + path: artifacts + - name: Package Web Build Artifacts + uses: ./.github/actions/package-web-build-artifacts + with: + fhirschemaversion: ${{ matrix.fhirSchemaVersion }} + majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + outputPath: ${{env.outputPath}} + buildConfiguration: ${{env.buildConfiguration}} + semVer: ${{needs.setup.outputs.semVer}} # - name: Docker Build # uses: ./.github/actions/docker-build # with: From a7fa0ae64e8af6b7bfaeb81655b40243e151417f Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 1 Apr 2024 13:53:53 -0700 Subject: [PATCH 099/149] Remove no longer needed matrix --- .github/workflows/fhir-oss-ci-pipeline.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 36007e88eb..80993996e2 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -73,9 +73,6 @@ jobs: buildAndUnitTest: runs-on: ubuntu-latest needs: setup - strategy: - matrix: - fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] steps: - name: Checkout uses: actions/checkout@v4 From 16c0544efd302dbc8c542c97070cda6ca7932522 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 2 Apr 2024 10:38:14 -0700 Subject: [PATCH 100/149] Migrated to primary yml file for uploads. --- .../package-web-build-artifacts/action.yml | 12 ++----- .github/workflows/fhir-oss-ci-pipeline.yml | 35 ++++++++++++++++++- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index 1d8f4da74c..54b7325689 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -19,14 +19,8 @@ inputs: runs: using: 'composite' steps: - - name: Create Nuget packages + - name: Publish Web Artifacts shell: bash run: | - echo "Creating Nuget packages for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet pack ${{github.workspace}} --output ${{inputs.outputPath}}/nupkgs --no-build --configuration=${{inputs.buildConfiguration}} -p:PackageVersion=${{inputs.majorMinorPatch}} - - name: Package Web Artifacts - shell: bash - run: | - echo "Packaging web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} - + echo "Publishing web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" + dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 80993996e2..e5b1e31272 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -110,6 +110,39 @@ jobs: uses: actions/upload-artifact@v4 with: path: ${{env.outputPath}} + - name: Create Nuget packages + shell: bash + run: | + echo "Creating Nuget packages for FHIR schema version ${{inputs.fhirSchemaVersion}}" + dotnet pack ${{github.workspace}} --output ${{inputs.outputPath}}/nupkgs --no-build --configuration=${{inputs.buildConfiguration}} -p:PackageVersion=${{inputs.majorMinorPatch}} + - name: Upload Nuget Packages + uses: actions/upload-artifact@v4 + with: + path: ${{env.outputPath}}/nupkgs + - name: Publish testauthenvironment.json to deploy directory + shell: bash + run: | + echo "Publishing testauthenvironment.json to deploy directory" + dotnet publish ${{github.workspace}}/testauthenvironment.json --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force + - name: Publish global.json to deploy directory + shell: bash + run: | + echo "Publishing global.json to deploy directory" + dotnet publish ${{github.workspace}}/global.json --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force + - name: Publish test configuration jsons to deploy directory + shell: bash + run: | + echo "Publishing test configuration jsons to deploy directory" + dotnet publish ${{github.workspace}}/test/Configuration --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force + - name: Publish release directory to deploy directory + shell: bash + run: | + echo "Publishing release directory to deploy directory" + dotnet publish ${{github.workspace}}/release --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force + - name: Upload deploy directory + uses: actions/upload-artifact@v4 + with: + path: ${{env.outputPath}}/deploy packageBuildArtifacts: runs-on: ubuntu-latest needs: [setup, buildAndUnitTest] @@ -136,7 +169,7 @@ jobs: uses: actions/download-artifact@v4 with: path: artifacts - - name: Package Web Build Artifacts + - name: Package and Publish Artifacts uses: ./.github/actions/package-web-build-artifacts with: fhirschemaversion: ${{ matrix.fhirSchemaVersion }} From d2c5afdc29d9689a8b3b1e999fa81195846fdbc4 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 2 Apr 2024 11:45:56 -0700 Subject: [PATCH 101/149] Fixed properties after moving --- .github/workflows/fhir-oss-ci-pipeline.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index e5b1e31272..9a5db76274 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -113,8 +113,8 @@ jobs: - name: Create Nuget packages shell: bash run: | - echo "Creating Nuget packages for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet pack ${{github.workspace}} --output ${{inputs.outputPath}}/nupkgs --no-build --configuration=${{inputs.buildConfiguration}} -p:PackageVersion=${{inputs.majorMinorPatch}} + echo "Creating Nuget packages" + dotnet pack ${{github.workspace}} --output ${{env.outputPath}}/nupkgs --no-build --configuration=${{env.buildConfiguration}} -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} - name: Upload Nuget Packages uses: actions/upload-artifact@v4 with: @@ -123,22 +123,22 @@ jobs: shell: bash run: | echo "Publishing testauthenvironment.json to deploy directory" - dotnet publish ${{github.workspace}}/testauthenvironment.json --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force + dotnet publish ${{github.workspace}}/testauthenvironment.json --output ${{env.outputPath}}/deploy --configuration ${{env.buildConfiguration}} --version-suffix ${{needs.setup.outputs.semVer}} --no-build -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force - name: Publish global.json to deploy directory shell: bash run: | echo "Publishing global.json to deploy directory" - dotnet publish ${{github.workspace}}/global.json --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force + dotnet publish ${{github.workspace}}/global.json --output ${{env.outputPath}}/deploy --configuration ${{env.buildConfiguration}} --version-suffix ${{needs.setup.outputs.semVer}} --no-build -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force - name: Publish test configuration jsons to deploy directory shell: bash run: | echo "Publishing test configuration jsons to deploy directory" - dotnet publish ${{github.workspace}}/test/Configuration --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force + dotnet publish ${{github.workspace}}/test/Configuration --output ${{env.outputPath}}/deploy --configuration ${{env.buildConfiguration}} --version-suffix ${{needs.setup.outputs.semVer}} --no-build -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force - name: Publish release directory to deploy directory shell: bash run: | echo "Publishing release directory to deploy directory" - dotnet publish ${{github.workspace}}/release --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force + dotnet publish ${{github.workspace}}/release --output ${{env.outputPath}}/deploy --configuration ${{env.buildConfiguration}} --version-suffix ${{needs.setup.outputs.semVer}} --no-build -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force - name: Upload deploy directory uses: actions/upload-artifact@v4 with: From 39ced0b380c5d7047033abcb7bf1f3ed54d66b4b Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 2 Apr 2024 12:07:07 -0700 Subject: [PATCH 102/149] Added name for each artifact upload as it was defaulting to artifact for all of them. --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 9a5db76274..ea548098b4 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -118,6 +118,7 @@ jobs: - name: Upload Nuget Packages uses: actions/upload-artifact@v4 with: + name: nupkgs path: ${{env.outputPath}}/nupkgs - name: Publish testauthenvironment.json to deploy directory shell: bash @@ -142,6 +143,7 @@ jobs: - name: Upload deploy directory uses: actions/upload-artifact@v4 with: + name: deploy path: ${{env.outputPath}}/deploy packageBuildArtifacts: runs-on: ubuntu-latest From 7223fd563ab5cd4f2ce04a7280beece13c9cc872 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 2 Apr 2024 13:00:19 -0700 Subject: [PATCH 103/149] Updated to copy for deploy folder. --- .github/workflows/fhir-oss-ci-pipeline.yml | 47 +++++++++++++++------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index ea548098b4..36cd198037 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -109,42 +109,59 @@ jobs: - name: Upload a Build Artifact uses: actions/upload-artifact@v4 with: + name: build path: ${{env.outputPath}} - name: Create Nuget packages shell: bash run: | echo "Creating Nuget packages" dotnet pack ${{github.workspace}} --output ${{env.outputPath}}/nupkgs --no-build --configuration=${{env.buildConfiguration}} -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} + - name: Upload Nuget Packages uses: actions/upload-artifact@v4 with: - name: nupkgs + name: nuget path: ${{env.outputPath}}/nupkgs - - name: Publish testauthenvironment.json to deploy directory + + - name: samples + shell: bash + run: | + echo "Copying samples to deploy directory" + cp -r ${{github.workspace}}/samples ${{env.outputPath}}/deploy + - name: Copying testauthenvironment.json to deploy directory shell: bash run: | - echo "Publishing testauthenvironment.json to deploy directory" - dotnet publish ${{github.workspace}}/testauthenvironment.json --output ${{env.outputPath}}/deploy --configuration ${{env.buildConfiguration}} --version-suffix ${{needs.setup.outputs.semVer}} --no-build -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force - - name: Publish global.json to deploy directory + echo "Copying testauthenvironment.json to deploy directory" + cp ${{github.workspace}}/testauthenvironment.json ${{env.outputPath}}/deploy/ + - name: Copying global.json to deploy directory shell: bash run: | - echo "Publishing global.json to deploy directory" - dotnet publish ${{github.workspace}}/global.json --output ${{env.outputPath}}/deploy --configuration ${{env.buildConfiguration}} --version-suffix ${{needs.setup.outputs.semVer}} --no-build -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force - - name: Publish test configuration jsons to deploy directory + echo "Copying global.json to deploy directory" + cp ${{github.workspace}}/global.json ${{env.outputPath}}/deploy/ + + - name: Copying test configuration json to deploy directory shell: bash run: | - echo "Publishing test configuration jsons to deploy directory" - dotnet publish ${{github.workspace}}/test/Configuration --output ${{env.outputPath}}/deploy --configuration ${{env.buildConfiguration}} --version-suffix ${{needs.setup.outputs.semVer}} --no-build -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force - - name: Publish release directory to deploy directory + echo "Copying test configuration json to deploy directory" + cp ${{github.workspace}}/test/Configuration/testconfiguration.json ${{env.outputPath}}/deploy/ + + - name: Copying release directory to deploy directory shell: bash run: | - echo "Publishing release directory to deploy directory" - dotnet publish ${{github.workspace}}/release --output ${{env.outputPath}}/deploy --configuration ${{env.buildConfiguration}} --version-suffix ${{needs.setup.outputs.semVer}} --no-build -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} --force + echo "Copying release directory to deploy directory" + cp -r ${{github.workspace}}/release ${{env.outputPath}}/deploy + - name: Upload deploy directory uses: actions/upload-artifact@v4 with: name: deploy path: ${{env.outputPath}}/deploy + + # - name: Upload Symbols + # uses: actions/ipload-artifact@v4 + # with: + # name: symbols + # path: ${{env.outputPath}}/bin/${{env.buildConfiguration}}/net5.0/publish packageBuildArtifacts: runs-on: ubuntu-latest needs: [setup, buildAndUnitTest] @@ -167,10 +184,12 @@ jobs: working-directory: ${{github.workspace}} shell: bash run: dotnet restore --verbosity detailed + - name: Download Build Artifacts from Job Cache uses: actions/download-artifact@v4 with: - path: artifacts + path: artifacts/build + - name: Package and Publish Artifacts uses: ./.github/actions/package-web-build-artifacts with: From b4dc30aee8988860106ee077b6c261f6f20b3661 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Tue, 2 Apr 2024 16:42:56 -0700 Subject: [PATCH 104/149] Added maxcpu 1 to fix file lock issue during build. --- .github/actions/dotnet-build/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 4adc3f4bca..91251854cb 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -22,4 +22,5 @@ runs: steps: - name: Build shell: bash - run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build -maxcpucount:1 --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + # using max cpu count of 1 to avoid file usage conflicts From b972e599481dcc7977ab6735ff0aff65109535ef Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 3 Apr 2024 09:18:38 -0700 Subject: [PATCH 105/149] Removing package version --- .github/actions/package-web-build-artifacts/action.yml | 2 +- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index 54b7325689..09039162b7 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -23,4 +23,4 @@ runs: shell: bash run: | echo "Publishing web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -p:PackageVersion=${{inputs.majorMinorPatch}} -f ${{env.defaultDotNetVersion}} + dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -f ${{env.defaultDotNetVersion}} diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 36cd198037..61bce4d1e6 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -104,7 +104,7 @@ jobs: # run: | # curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64 # chmod +x $RUNNER_TEMP/sbom-tool - # $RUNNER_TEMP/sbom-tool generate -b . -bc . -V Verbose -ps "Organization: Microsoft" -pv ${{needs.setup.outputs.majorMinorPatch}} -pn ${{needs.setup.outputs.informationalVersion}} + # $RUNNER_TEMP/sbom-tool generate -b ${{env.outputPath}} -bc . -V Verbose -ps "Organization: Microsoft" -pv ${{needs.setup.outputs.majorMinorPatch}} -pn ${{needs.setup.outputs.informationalVersion}} - name: Upload a Build Artifact uses: actions/upload-artifact@v4 From fb562b7d858a154995bfb77fe074562e31fc46ce Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 3 Apr 2024 14:39:01 -0700 Subject: [PATCH 106/149] Added in docker image create and symbols publishing. --- .github/actions/docker-build/action.yml | 5 +- .github/workflows/fhir-oss-ci-pipeline.yml | 110 ++++++++++++++------- 2 files changed, 73 insertions(+), 42 deletions(-) diff --git a/.github/actions/docker-build/action.yml b/.github/actions/docker-build/action.yml index 5e66230270..3d9f5ebf54 100644 --- a/.github/actions/docker-build/action.yml +++ b/.github/actions/docker-build/action.yml @@ -2,9 +2,6 @@ name: Docker Build description: 'Builds images for all supported FHIR versions' inputs: - tag: - description: 'The tag to apply to the images' - required: true fhirSchemaVersion: description: 'The FHIR schema version to package' required: true @@ -18,7 +15,7 @@ inputs: runs: using: 'composite' steps: - - name: Build and Push Docker Images + - name: Build Docker Image shell: bash run: | echo "Building and pushing Docker images for FHIR schema version ${{inputs.fhirSchemaVersion}}" diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 61bce4d1e6..c797352bc4 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -128,11 +128,13 @@ jobs: run: | echo "Copying samples to deploy directory" cp -r ${{github.workspace}}/samples ${{env.outputPath}}/deploy + - name: Copying testauthenvironment.json to deploy directory shell: bash run: | echo "Copying testauthenvironment.json to deploy directory" cp ${{github.workspace}}/testauthenvironment.json ${{env.outputPath}}/deploy/ + - name: Copying global.json to deploy directory shell: bash run: | @@ -151,57 +153,89 @@ jobs: echo "Copying release directory to deploy directory" cp -r ${{github.workspace}}/release ${{env.outputPath}}/deploy - - name: Upload deploy directory - uses: actions/upload-artifact@v4 - with: - name: deploy - path: ${{env.outputPath}}/deploy + - name: Copying pdb files to symbols directory + shell: bash + run: | + echo "Copying pdb files to deploy symbols" + shopt -s globstar + cp -r ${{github.workspace}}/src/**/*.pdb ${{env.outputPath}}/symbols - # - name: Upload Symbols - # uses: actions/ipload-artifact@v4 - # with: - # name: symbols - # path: ${{env.outputPath}}/bin/${{env.buildConfiguration}}/net5.0/publish - packageBuildArtifacts: - runs-on: ubuntu-latest - needs: [setup, buildAndUnitTest] - strategy: - matrix: - fhirSchemaVersion: ["Stu3", "R4", "R4B", "R5"] - steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Publish Stu3 Web Artifacts to deploy directory + uses: ./.github/actions/package-web-build-artifacts with: - fetch-depth: 0 - - name: Install Latest .Net SDK - uses: actions/setup-dotnet@v4 + fhirschemaversion: "Stu3" + majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + outputPath: ${{env.outputPath}} + buildConfiguration: ${{env.buildConfiguration}} + semVer: ${{needs.setup.outputs.semVer}} + + - name: Publish R4 Web Artifacts to deploy directory + uses: ./.github/actions/package-web-build-artifacts with: - global-json-file: 'global.json' - dotnet-version: | - 6.x - 8.x - - name: Nuget Restore - working-directory: ${{github.workspace}} - shell: bash - run: dotnet restore --verbosity detailed + fhirschemaversion: "R4" + majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + outputPath: ${{env.outputPath}} + buildConfiguration: ${{env.buildConfiguration}} + semVer: ${{needs.setup.outputs.semVer}} - - name: Download Build Artifacts from Job Cache - uses: actions/download-artifact@v4 + - name: Publish R4B Web Artifacts to deploy directory + uses: ./.github/actions/package-web-build-artifacts with: - path: artifacts/build + fhirschemaversion: "R4B" + majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} + outputPath: ${{env.outputPath}} + buildConfiguration: ${{env.buildConfiguration}} + semVer: ${{needs.setup.outputs.semVer}} - - name: Package and Publish Artifacts + - name: Publish R5 Web Artifacts to deploy directory uses: ./.github/actions/package-web-build-artifacts with: - fhirschemaversion: ${{ matrix.fhirSchemaVersion }} + fhirschemaversion: "R5" majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} outputPath: ${{env.outputPath}} buildConfiguration: ${{env.buildConfiguration}} semVer: ${{needs.setup.outputs.semVer}} - # - name: Docker Build - # uses: ./.github/actions/docker-build + + - name: Docker Build Stu3 Image + uses: ./.github/actions/docker-build + with: + assemblySemFileVer: ${{needs.setup.outputs.semVer}} + fhirSchemaVersion: "Stu3" + composeLocation: ${{env.composeLocation}} + + - name: Docker Build R4 Image + uses: ./.github/actions/docker-build + with: + assemblySemFileVer: ${{needs.setup.outputs.semVer}} + fhirSchemaVersion: "R4" + composeLocation: ${{env.composeLocation}} + + - name: Docker Build R4B Image + uses: ./.github/actions/docker-build + with: + assemblySemFileVer: ${{needs.setup.outputs.semVer}} + fhirSchemaVersion: "R4B" + composeLocation: ${{env.composeLocation}} + + - name: Docker Build R5 Image + uses: ./.github/actions/docker-build + with: + assemblySemFileVer: ${{needs.setup.outputs.semVer}} + fhirSchemaVersion: "R5" + composeLocation: ${{env.composeLocation}} + + - name: Upload deploy directory + uses: actions/upload-artifact@v4 + with: + name: deploy + path: ${{env.outputPath}}/deploy + + # - name: Upload Symbols + # uses: actions/upload-artifact@v4 # with: - # assemblySemFileVer: ${{needs.setup.outputs.semVer}} + # name: symbols + # path: ${{env.outputPath}}/bin/${{env.buildConfiguration}}/net5.0/publish + # runIntegrationTests: # runs-on: ubuntu-latest # needs : buildAndUnitTest From f3bbcc2e6f9b8f9f17cdf8edc08a6d603b5dcab8 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 3 Apr 2024 14:50:03 -0700 Subject: [PATCH 107/149] Commenting out symbols for now --- .github/workflows/fhir-oss-ci-pipeline.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index c797352bc4..f00b79a298 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -153,12 +153,12 @@ jobs: echo "Copying release directory to deploy directory" cp -r ${{github.workspace}}/release ${{env.outputPath}}/deploy - - name: Copying pdb files to symbols directory - shell: bash - run: | - echo "Copying pdb files to deploy symbols" - shopt -s globstar - cp -r ${{github.workspace}}/src/**/*.pdb ${{env.outputPath}}/symbols + # - name: Copying pdb files to symbols directory + # shell: bash + # run: | + # echo "Copying pdb files to deploy symbols" + # shopt -s globstar + # cp -r ${{github.workspace}}/src/**/*.pdb ${{env.outputPath}}/symbols - name: Publish Stu3 Web Artifacts to deploy directory uses: ./.github/actions/package-web-build-artifacts From 552102e4826840642e45c1fd378dbcbdbaa329cb Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 3 Apr 2024 17:05:15 -0700 Subject: [PATCH 108/149] Fixes --- .github/actions/package-web-build-artifacts/action.yml | 2 +- .github/workflows/fhir-oss-ci-pipeline.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index 09039162b7..e1d33f694c 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -23,4 +23,4 @@ runs: shell: bash run: | echo "Publishing web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" - dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/deploy --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -f ${{env.defaultDotNetVersion}} + # dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/deploy/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -f ${{env.defaultDotNetVersion}} diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index f00b79a298..4306af386f 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -199,28 +199,28 @@ jobs: - name: Docker Build Stu3 Image uses: ./.github/actions/docker-build with: - assemblySemFileVer: ${{needs.setup.outputs.semVer}} + assemblyVersion: ${{needs.setup.outputs.semVer}} fhirSchemaVersion: "Stu3" composeLocation: ${{env.composeLocation}} - name: Docker Build R4 Image uses: ./.github/actions/docker-build with: - assemblySemFileVer: ${{needs.setup.outputs.semVer}} + assemblyVersion: ${{needs.setup.outputs.semVer}} fhirSchemaVersion: "R4" composeLocation: ${{env.composeLocation}} - name: Docker Build R4B Image uses: ./.github/actions/docker-build with: - assemblySemFileVer: ${{needs.setup.outputs.semVer}} + assemblyVersion: ${{needs.setup.outputs.semVer}} fhirSchemaVersion: "R4B" composeLocation: ${{env.composeLocation}} - name: Docker Build R5 Image uses: ./.github/actions/docker-build with: - assemblySemFileVer: ${{needs.setup.outputs.semVer}} + assemblyVersion: ${{needs.setup.outputs.semVer}} fhirSchemaVersion: "R5" composeLocation: ${{env.composeLocation}} From 92cbae7165d5dea0035def5ca0d2056dddd94a59 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 3 Apr 2024 17:28:10 -0700 Subject: [PATCH 109/149] Adding zip command --- .github/actions/package-web-build-artifacts/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index e1d33f694c..62cbebe807 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -23,4 +23,5 @@ runs: shell: bash run: | echo "Publishing web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" - # dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/deploy/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -f ${{env.defaultDotNetVersion}} + dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/deploy/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -f ${{env.defaultDotNetVersion}} + zip -r Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.zip ${{inputs.outputPath}}/deploy/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web From a33d79f4b1dbc7838e020c7f5f5aa32f6f82cd86 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Wed, 3 Apr 2024 18:19:07 -0700 Subject: [PATCH 110/149] Copy root docker yaml file --- .github/workflows/fhir-oss-ci-pipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 4306af386f..91159cc768 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -147,11 +147,11 @@ jobs: echo "Copying test configuration json to deploy directory" cp ${{github.workspace}}/test/Configuration/testconfiguration.json ${{env.outputPath}}/deploy/ - - name: Copying release directory to deploy directory + - name: Copying docker compose root file to deploy directory shell: bash run: | - echo "Copying release directory to deploy directory" - cp -r ${{github.workspace}}/release ${{env.outputPath}}/deploy + echo "Copying docker compose root file to deploy directory" + cp ${{github.workspace}}/docker-compose.yaml ${{env.outputPath}}/deploy # - name: Copying pdb files to symbols directory # shell: bash From f0c1e7703d7dcee8b3cc6859dd96b176760704ee Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 4 Apr 2024 09:30:27 -0700 Subject: [PATCH 111/149] Updated docker compose and web package --- .github/actions/docker-build/action.yml | 2 +- .github/actions/package-web-build-artifacts/action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/docker-build/action.yml b/.github/actions/docker-build/action.yml index 3d9f5ebf54..74a0468794 100644 --- a/.github/actions/docker-build/action.yml +++ b/.github/actions/docker-build/action.yml @@ -19,4 +19,4 @@ runs: shell: bash run: | echo "Building and pushing Docker images for FHIR schema version ${{inputs.fhirSchemaVersion}}" - docker-compose -f ${{inputs.composeLocation}} build -p ${{inputs.fhirSchemaVersion}} --build-arg FHIR_VERSION=${{inputs.fhirSchemaVersion}} --build-arg ASSEMBLY_VER=${{inputs.assemblyVersion}} + docker-compose build --build-arg FHIR_VERSION=${{inputs.fhirSchemaVersion}} --build-arg ASSEMBLY_VER=${{inputs.assemblyVersion}} diff --git a/.github/actions/package-web-build-artifacts/action.yml b/.github/actions/package-web-build-artifacts/action.yml index 62cbebe807..682417286f 100644 --- a/.github/actions/package-web-build-artifacts/action.yml +++ b/.github/actions/package-web-build-artifacts/action.yml @@ -24,4 +24,4 @@ runs: run: | echo "Publishing web artifacts for FHIR schema version ${{inputs.fhirSchemaVersion}}" dotnet publish ${{github.workspace}}/src/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.csproj --output ${{inputs.outputPath}}/deploy/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web --configuration ${{inputs.buildConfiguration}} --version-suffix ${{inputs.semVer}} --no-build -f ${{env.defaultDotNetVersion}} - zip -r Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.zip ${{inputs.outputPath}}/deploy/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web + zip Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web.zip ${{inputs.outputPath}}/deploy/Microsoft.Health.Fhir.${{inputs.fhirSchemaVersion}}.Web From 19727dcb209e39a2ff4e5562c1b593b5996d89a1 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 4 Apr 2024 09:58:07 -0700 Subject: [PATCH 112/149] Updated created docker compose file from release --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 91159cc768..fba43cd34a 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -151,7 +151,7 @@ jobs: shell: bash run: | echo "Copying docker compose root file to deploy directory" - cp ${{github.workspace}}/docker-compose.yaml ${{env.outputPath}}/deploy + cp ${{github.workspace}}/release/docker-compose.yaml ${{env.outputPath}}/deploy # - name: Copying pdb files to symbols directory # shell: bash From fe1e3a0fa7eb6aa50131054a695de993ca857aed Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 4 Apr 2024 10:30:11 -0700 Subject: [PATCH 113/149] Updating working path for docker build --- .github/actions/docker-build/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/docker-build/action.yml b/.github/actions/docker-build/action.yml index 74a0468794..f88b723d79 100644 --- a/.github/actions/docker-build/action.yml +++ b/.github/actions/docker-build/action.yml @@ -19,4 +19,5 @@ runs: shell: bash run: | echo "Building and pushing Docker images for FHIR schema version ${{inputs.fhirSchemaVersion}}" + cd ${{github.workspace}}/build docker-compose build --build-arg FHIR_VERSION=${{inputs.fhirSchemaVersion}} --build-arg ASSEMBLY_VER=${{inputs.assemblyVersion}} From deb4482a069af087b4c2773ebba027f72a1763b0 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 4 Apr 2024 10:49:00 -0700 Subject: [PATCH 114/149] Shortening root path --- .github/actions/docker-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker-build/action.yml b/.github/actions/docker-build/action.yml index f88b723d79..8dd80f5c20 100644 --- a/.github/actions/docker-build/action.yml +++ b/.github/actions/docker-build/action.yml @@ -19,5 +19,5 @@ runs: shell: bash run: | echo "Building and pushing Docker images for FHIR schema version ${{inputs.fhirSchemaVersion}}" - cd ${{github.workspace}}/build + cd ${{github.workspace}} docker-compose build --build-arg FHIR_VERSION=${{inputs.fhirSchemaVersion}} --build-arg ASSEMBLY_VER=${{inputs.assemblyVersion}} From 2cd31c568e9c33125a570bf96f31b26e90736cbe Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 4 Apr 2024 11:02:50 -0700 Subject: [PATCH 115/149] Trying to figure out current working path during docker creation --- .github/actions/docker-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker-build/action.yml b/.github/actions/docker-build/action.yml index 8dd80f5c20..8ded812923 100644 --- a/.github/actions/docker-build/action.yml +++ b/.github/actions/docker-build/action.yml @@ -19,5 +19,5 @@ runs: shell: bash run: | echo "Building and pushing Docker images for FHIR schema version ${{inputs.fhirSchemaVersion}}" - cd ${{github.workspace}} + pwd docker-compose build --build-arg FHIR_VERSION=${{inputs.fhirSchemaVersion}} --build-arg ASSEMBLY_VER=${{inputs.assemblyVersion}} From 7a1b427c88e65f8e52b0bd887cce838203bf661b Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 4 Apr 2024 11:20:19 -0700 Subject: [PATCH 116/149] Docker compose path update --- .github/actions/docker-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker-build/action.yml b/.github/actions/docker-build/action.yml index 8ded812923..1ce5a0ec13 100644 --- a/.github/actions/docker-build/action.yml +++ b/.github/actions/docker-build/action.yml @@ -19,5 +19,5 @@ runs: shell: bash run: | echo "Building and pushing Docker images for FHIR schema version ${{inputs.fhirSchemaVersion}}" - pwd + cd build/docker docker-compose build --build-arg FHIR_VERSION=${{inputs.fhirSchemaVersion}} --build-arg ASSEMBLY_VER=${{inputs.assemblyVersion}} From 885d2b397730a22b670b1776f59234730cc1b118 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 4 Apr 2024 11:38:51 -0700 Subject: [PATCH 117/149] Improper version format --- .github/workflows/fhir-oss-ci-pipeline.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index fba43cd34a..a4dee26c7f 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -199,28 +199,28 @@ jobs: - name: Docker Build Stu3 Image uses: ./.github/actions/docker-build with: - assemblyVersion: ${{needs.setup.outputs.semVer}} + assemblyVersion: ${{needs.setup.outputs.majorMinorPatch}} fhirSchemaVersion: "Stu3" composeLocation: ${{env.composeLocation}} - name: Docker Build R4 Image uses: ./.github/actions/docker-build with: - assemblyVersion: ${{needs.setup.outputs.semVer}} + assemblyVersion: ${{needs.setup.outputs.majorMinorPatch}} fhirSchemaVersion: "R4" composeLocation: ${{env.composeLocation}} - name: Docker Build R4B Image uses: ./.github/actions/docker-build with: - assemblyVersion: ${{needs.setup.outputs.semVer}} + assemblyVersion: ${{needs.setup.outputs.majorMinorPatch}} fhirSchemaVersion: "R4B" composeLocation: ${{env.composeLocation}} - name: Docker Build R5 Image uses: ./.github/actions/docker-build with: - assemblyVersion: ${{needs.setup.outputs.semVer}} + assemblyVersion: ${{needs.setup.outputs.majorMinorPatch}} fhirSchemaVersion: "R5" composeLocation: ${{env.composeLocation}} From 9e51b099b52a208b30a01c983a0e676649a1222e Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 4 Apr 2024 12:08:20 -0700 Subject: [PATCH 118/149] Updated to use our self hosted runner --- .github/workflows/fhir-oss-ci-pipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index a4dee26c7f..325148ed3f 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -25,7 +25,7 @@ env: jobs: setup: - runs-on: ubuntu-latest + runs-on: [self-hosted, 1ES.Pool=GithubRunPool] env: deploymentEnvironmentName: $vars.CIRESOURCEGROUPROOT appServicePlanName: $vars.CIRESOURCEGROUPROOT-linux @@ -71,7 +71,7 @@ jobs: # with: # environmentName: ${{vars.CIRESOURCEGROUPROOT}} buildAndUnitTest: - runs-on: ubuntu-latest + runs-on: [self-hosted, 1ES.Pool=GithubRunPool] needs: setup steps: - name: Checkout @@ -237,7 +237,7 @@ jobs: # path: ${{env.outputPath}}/bin/${{env.buildConfiguration}}/net5.0/publish # runIntegrationTests: - # runs-on: ubuntu-latest + # runs-on: [self-hosted, 1ES.Pool=GithubRunPool] # needs : buildAndUnitTest # steps: # - name: Checkout From 7d79fad2b5e455d1f467a5526b3070841241d5b9 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 4 Apr 2024 14:27:18 -0700 Subject: [PATCH 119/149] Uncommented unit tests to try again. Updated symbols copy --- .github/workflows/fhir-oss-ci-pipeline.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 325148ed3f..cfaae47203 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -95,17 +95,17 @@ jobs: fileVersion: ${{needs.setup.outputs.fileVersion}} informationalVersion: ${{needs.setup.outputs.informationalVersion}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - # - name: Test - # uses: ./.github/actions/dotnet-test - # with: - # buildConfiguration: ${{env.buildConfiguration}} + - name: Test + uses: ./.github/actions/dotnet-test + with: + buildConfiguration: ${{env.buildConfiguration}} # - name: Generate SBOM # run: | # curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/latest/download/sbom-tool-linux-x64 # chmod +x $RUNNER_TEMP/sbom-tool # $RUNNER_TEMP/sbom-tool generate -b ${{env.outputPath}} -bc . -V Verbose -ps "Organization: Microsoft" -pv ${{needs.setup.outputs.majorMinorPatch}} -pn ${{needs.setup.outputs.informationalVersion}} - + - name: Upload a Build Artifact uses: actions/upload-artifact@v4 with: @@ -153,12 +153,11 @@ jobs: echo "Copying docker compose root file to deploy directory" cp ${{github.workspace}}/release/docker-compose.yaml ${{env.outputPath}}/deploy - # - name: Copying pdb files to symbols directory - # shell: bash - # run: | - # echo "Copying pdb files to deploy symbols" - # shopt -s globstar - # cp -r ${{github.workspace}}/src/**/*.pdb ${{env.outputPath}}/symbols + - name: Copying pdb files to symbols directory + shell: bash + run: | + echo "Copying pdb files to deploy symbols" + find ${{github.workspace}}/src -type f -name "*.pdb" ! -name "*UnitTest*"-exec cp {} ${{env.outputPath}}/symbols \; - name: Publish Stu3 Web Artifacts to deploy directory uses: ./.github/actions/package-web-build-artifacts From a9103a4ff981fc4030fefd6f19e6a770b3ceeb44 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Thu, 4 Apr 2024 19:32:27 -0700 Subject: [PATCH 120/149] Added max cpu 1 to get around file in use issues. --- .github/actions/dotnet-test/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-test/action.yml b/.github/actions/dotnet-test/action.yml index e15a750bb4..0887ea3187 100644 --- a/.github/actions/dotnet-test/action.yml +++ b/.github/actions/dotnet-test/action.yml @@ -9,4 +9,4 @@ runs: steps: - name: Run Unit Tests shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" -maxcpucount:1 --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal From 366e4777e1ba9cc9bb029154d94ea52a37bb8027 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 5 Apr 2024 10:09:40 -0700 Subject: [PATCH 121/149] Switched to windows runner and removed maxcpu as that was slowing things down too much. --- .github/actions/dotnet-build/action.yml | 2 +- .github/actions/dotnet-test/action.yml | 2 +- .github/workflows/fhir-oss-ci-pipeline.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 91251854cb..68ffa1fc71 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -22,5 +22,5 @@ runs: steps: - name: Build shell: bash - run: dotnet build -maxcpucount:1 --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror # using max cpu count of 1 to avoid file usage conflicts diff --git a/.github/actions/dotnet-test/action.yml b/.github/actions/dotnet-test/action.yml index 0887ea3187..e15a750bb4 100644 --- a/.github/actions/dotnet-test/action.yml +++ b/.github/actions/dotnet-test/action.yml @@ -9,4 +9,4 @@ runs: steps: - name: Run Unit Tests shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" -maxcpucount:1 --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index cfaae47203..6cc33abb1f 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -71,7 +71,7 @@ jobs: # with: # environmentName: ${{vars.CIRESOURCEGROUPROOT}} buildAndUnitTest: - runs-on: [self-hosted, 1ES.Pool=GithubRunPool] + runs-on: [self-hosted, 1ES.Pool=GithubRunPool, Windows] needs: setup steps: - name: Checkout @@ -236,7 +236,7 @@ jobs: # path: ${{env.outputPath}}/bin/${{env.buildConfiguration}}/net5.0/publish # runIntegrationTests: - # runs-on: [self-hosted, 1ES.Pool=GithubRunPool] + # runs-on: [self-hosted, 1ES.Pool=GithubRunPool, Windows] # needs : buildAndUnitTest # steps: # - name: Checkout From f6ca76b784f55c9bd8100d71ad43d3546def52f0 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 5 Apr 2024 11:13:15 -0700 Subject: [PATCH 122/149] Fixing symbols publishing --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 6cc33abb1f..cf7e4514da 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -157,7 +157,7 @@ jobs: shell: bash run: | echo "Copying pdb files to deploy symbols" - find ${{github.workspace}}/src -type f -name "*.pdb" ! -name "*UnitTest*"-exec cp {} ${{env.outputPath}}/symbols \; + find ${{github.workspace}}/src -type f -name "*.pdb" ! -name "*UnitTest*" -exec cp {} ${{env.outputPath}}/symbols \; - name: Publish Stu3 Web Artifacts to deploy directory uses: ./.github/actions/package-web-build-artifacts From 9dfc420357dccc7738cad6ece591c804016738e7 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 5 Apr 2024 11:23:23 -0700 Subject: [PATCH 123/149] Switching build job to windows latest runner --- .github/workflows/fhir-oss-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index cf7e4514da..839276a537 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -71,7 +71,7 @@ jobs: # with: # environmentName: ${{vars.CIRESOURCEGROUPROOT}} buildAndUnitTest: - runs-on: [self-hosted, 1ES.Pool=GithubRunPool, Windows] + runs-on: windows-latest needs: setup steps: - name: Checkout From a90cd0cc2003861c8e3a57edf6f3f1e538c21c71 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 5 Apr 2024 12:19:28 -0700 Subject: [PATCH 124/149] Commenting out unit tests --- .github/workflows/fhir-oss-ci-pipeline.yml | 26 ++++++++-------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 839276a537..c1107d3ed2 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -79,14 +79,6 @@ jobs: with: fetch-depth: 0 - - name: Install Latest .Net SDK - uses: actions/setup-dotnet@v4 - with: - global-json-file: 'global.json' - dotnet-version: | - 6.x - 8.x - - name: Build uses: ./.github/actions/dotnet-build with: @@ -95,10 +87,10 @@ jobs: fileVersion: ${{needs.setup.outputs.fileVersion}} informationalVersion: ${{needs.setup.outputs.informationalVersion}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - - name: Test - uses: ./.github/actions/dotnet-test - with: - buildConfiguration: ${{env.buildConfiguration}} + # - name: Test + # uses: ./.github/actions/dotnet-test + # with: + # buildConfiguration: ${{env.buildConfiguration}} # - name: Generate SBOM # run: | @@ -106,11 +98,11 @@ jobs: # chmod +x $RUNNER_TEMP/sbom-tool # $RUNNER_TEMP/sbom-tool generate -b ${{env.outputPath}} -bc . -V Verbose -ps "Organization: Microsoft" -pv ${{needs.setup.outputs.majorMinorPatch}} -pn ${{needs.setup.outputs.informationalVersion}} - - name: Upload a Build Artifact - uses: actions/upload-artifact@v4 - with: - name: build - path: ${{env.outputPath}} + # - name: Upload a Build Artifact + # uses: actions/upload-artifact@v4 + # with: + # name: build + # path: ${{env.outputPath}} - name: Create Nuget packages shell: bash run: | From 0c35741702877b737d60cb07ba928cbc5364b856 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 5 Apr 2024 12:50:00 -0700 Subject: [PATCH 125/149] Adding no restore to test run --- .github/actions/dotnet-test/action.yml | 2 +- .github/workflows/fhir-oss-ci-pipeline.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/dotnet-test/action.yml b/.github/actions/dotnet-test/action.yml index e15a750bb4..543f0b6d6f 100644 --- a/.github/actions/dotnet-test/action.yml +++ b/.github/actions/dotnet-test/action.yml @@ -9,4 +9,4 @@ runs: steps: - name: Run Unit Tests shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" --no-restore --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index c1107d3ed2..6c85a8fdc8 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -87,10 +87,10 @@ jobs: fileVersion: ${{needs.setup.outputs.fileVersion}} informationalVersion: ${{needs.setup.outputs.informationalVersion}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - # - name: Test - # uses: ./.github/actions/dotnet-test - # with: - # buildConfiguration: ${{env.buildConfiguration}} + - name: Test + uses: ./.github/actions/dotnet-test + with: + buildConfiguration: ${{env.buildConfiguration}} # - name: Generate SBOM # run: | @@ -107,7 +107,7 @@ jobs: shell: bash run: | echo "Creating Nuget packages" - dotnet pack ${{github.workspace}} --output ${{env.outputPath}}/nupkgs --no-build --configuration=${{env.buildConfiguration}} -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} + dotnet pack ${{github.workspace}}\Microsoft.Health.Fhir.sln --output ${{env.outputPath}}/nupkgs --no-build --configuration=${{env.buildConfiguration}} -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} - name: Upload Nuget Packages uses: actions/upload-artifact@v4 From 56cda9c85b60791fc7a3ca6404d07696f3cc9dd5 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 5 Apr 2024 14:52:53 -0700 Subject: [PATCH 126/149] Minor tweaks to see if that resolves file in use issue --- .github/actions/dotnet-build/action.yml | 3 +-- .github/actions/dotnet-test/action.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index 68ffa1fc71..b9127d813a 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -22,5 +22,4 @@ runs: steps: - name: Build shell: bash - run: dotnet build --configuration ${{inputs.buildConfiguration}} -p:ContinuousIntegrationBuild=true -p:AssemblyVersion="${{inputs.assemblyVersion}}" -p:FileVersion="${{inputs.fileVersion}}" -p:InformationalVersion="${{inputs.informationalVersion}}" -p:Version="${{inputs.majorMinorPatch}}" -warnaserror - # using max cpu count of 1 to avoid file usage conflicts + run: dotnet build "./Microsoft.Health.Fhir.sln" --configuration ${{inputs.buildConfiguration}} "-p:ContinuousIntegrationBuild=true;AssemblyVersion=${{inputs.assemblyVersion}};FileVersion=${{inputs.fileVersion}};InformationalVersion=${{inputs.informationalVersion}};Version=${{inputs.majorMinorPatch}}" -warnaserror diff --git a/.github/actions/dotnet-test/action.yml b/.github/actions/dotnet-test/action.yml index 543f0b6d6f..26f17de674 100644 --- a/.github/actions/dotnet-test/action.yml +++ b/.github/actions/dotnet-test/action.yml @@ -9,4 +9,4 @@ runs: steps: - name: Run Unit Tests shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" --no-restore --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal From 13399c280770472e15dc0b33bd590b80cb7a94e2 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 5 Apr 2024 15:13:20 -0700 Subject: [PATCH 127/149] Adding maxcpucount back in. It exponentially increases build time. --- .github/actions/dotnet-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index b9127d813a..b87c47437a 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -22,4 +22,4 @@ runs: steps: - name: Build shell: bash - run: dotnet build "./Microsoft.Health.Fhir.sln" --configuration ${{inputs.buildConfiguration}} "-p:ContinuousIntegrationBuild=true;AssemblyVersion=${{inputs.assemblyVersion}};FileVersion=${{inputs.fileVersion}};InformationalVersion=${{inputs.informationalVersion}};Version=${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build "./Microsoft.Health.Fhir.sln" --maxcpucount:1 --configuration ${{inputs.buildConfiguration}} "-p:ContinuousIntegrationBuild=true;AssemblyVersion=${{inputs.assemblyVersion}};FileVersion=${{inputs.fileVersion}};InformationalVersion=${{inputs.informationalVersion}};Version=${{inputs.majorMinorPatch}}" -warnaserror From 00ae7424fef67ee64569ef66cd46d6ad89e6c367 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 5 Apr 2024 15:54:53 -0700 Subject: [PATCH 128/149] Bundling unit tests into collection to run them sequentially to prevent file locks --- .../Features/Operations/Import/ImportOrchestratorJobTests.cs | 1 + .../Features/Operations/Import/ImportProcessingJobTests.cs | 1 + .../Features/Search/CustomQueriesUnitTests.cs | 1 + .../Features/Search/Expressions/FlatteningRewriterTests.cs | 1 + .../Expressions/LastUpdatedToResourceSurrogateIdRewriterTests.cs | 1 + .../Search/Expressions/SqlServerSortingValidatorTests.cs | 1 + 6 files changed, 6 insertions(+) diff --git a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Operations/Import/ImportOrchestratorJobTests.cs b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Operations/Import/ImportOrchestratorJobTests.cs index 2175b86a41..d6b3e0b399 100644 --- a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Operations/Import/ImportOrchestratorJobTests.cs +++ b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Operations/Import/ImportOrchestratorJobTests.cs @@ -32,6 +32,7 @@ namespace Microsoft.Health.Fhir.SqlServer.UnitTests.Features.Operations.Import { + [Collection("Sequential")] [Trait(Traits.OwningTeam, OwningTeam.FhirImport)] [Trait(Traits.Category, Categories.Import)] public class ImportOrchestratorJobTests diff --git a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Operations/Import/ImportProcessingJobTests.cs b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Operations/Import/ImportProcessingJobTests.cs index 1769b3aebb..38c1c0f0be 100644 --- a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Operations/Import/ImportProcessingJobTests.cs +++ b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Operations/Import/ImportProcessingJobTests.cs @@ -26,6 +26,7 @@ namespace Microsoft.Health.Fhir.SqlServer.UnitTests.Features.Operations.Import { + [Collection("Sequential")] [Trait(Traits.OwningTeam, OwningTeam.FhirImport)] [Trait(Traits.Category, Categories.Import)] public class ImportProcessingJobTests diff --git a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/CustomQueriesUnitTests.cs b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/CustomQueriesUnitTests.cs index 736493dd7b..09c328ae80 100644 --- a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/CustomQueriesUnitTests.cs +++ b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/CustomQueriesUnitTests.cs @@ -14,6 +14,7 @@ namespace Microsoft.Health.Fhir.SqlServer.UnitTests.Features.Search { + [Collection("Sequential")] [Trait(Traits.OwningTeam, OwningTeam.Fhir)] [Trait(Traits.Category, Categories.Search)] public class CustomQueriesUnitTests diff --git a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/FlatteningRewriterTests.cs b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/FlatteningRewriterTests.cs index da35abbc56..568095f336 100644 --- a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/FlatteningRewriterTests.cs +++ b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/FlatteningRewriterTests.cs @@ -11,6 +11,7 @@ namespace Microsoft.Health.Fhir.SqlServer.UnitTests.Features.Search.Expressions { + [Collection("Sequential")] [Trait(Traits.OwningTeam, OwningTeam.Fhir)] [Trait(Traits.Category, Categories.Search)] public class FlatteningRewriterTests diff --git a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/LastUpdatedToResourceSurrogateIdRewriterTests.cs b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/LastUpdatedToResourceSurrogateIdRewriterTests.cs index 058edaaac3..578f8fcecf 100644 --- a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/LastUpdatedToResourceSurrogateIdRewriterTests.cs +++ b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/LastUpdatedToResourceSurrogateIdRewriterTests.cs @@ -14,6 +14,7 @@ namespace Microsoft.Health.Fhir.SqlServer.UnitTests.Features.Search.Expressions { + [Collection("Sequential")] [Trait(Traits.OwningTeam, OwningTeam.Fhir)] [Trait(Traits.Category, Categories.Search)] public class LastUpdatedToResourceSurrogateIdRewriterTests diff --git a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/SqlServerSortingValidatorTests.cs b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/SqlServerSortingValidatorTests.cs index 9cabbd508a..3d5f664f87 100644 --- a/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/SqlServerSortingValidatorTests.cs +++ b/src/Microsoft.Health.Fhir.SqlServer.UnitTests/Features/Search/Expressions/SqlServerSortingValidatorTests.cs @@ -17,6 +17,7 @@ namespace Microsoft.Health.Fhir.SqlServer.UnitTests.Features.Search.Expressions { + [Collection("Sequential")] [Trait(Traits.OwningTeam, OwningTeam.Fhir)] [Trait(Traits.Category, Categories.Search)] public class SqlServerSortingValidatorTests From 5da9f620a9539104eef326513dadce7f9ceffd1a Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 8 Apr 2024 11:13:31 -0700 Subject: [PATCH 129/149] Setting BuildTimeCodeGenerator to build time dependency to try and resolve file issue. --- .github/actions/dotnet-build/action.yml | 2 +- .../Microsoft.Health.Fhir.SqlServer.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index b87c47437a..b9127d813a 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -22,4 +22,4 @@ runs: steps: - name: Build shell: bash - run: dotnet build "./Microsoft.Health.Fhir.sln" --maxcpucount:1 --configuration ${{inputs.buildConfiguration}} "-p:ContinuousIntegrationBuild=true;AssemblyVersion=${{inputs.assemblyVersion}};FileVersion=${{inputs.fileVersion}};InformationalVersion=${{inputs.informationalVersion}};Version=${{inputs.majorMinorPatch}}" -warnaserror + run: dotnet build "./Microsoft.Health.Fhir.sln" --configuration ${{inputs.buildConfiguration}} "-p:ContinuousIntegrationBuild=true;AssemblyVersion=${{inputs.assemblyVersion}};FileVersion=${{inputs.fileVersion}};InformationalVersion=${{inputs.informationalVersion}};Version=${{inputs.majorMinorPatch}}" -warnaserror diff --git a/src/Microsoft.Health.Fhir.SqlServer/Microsoft.Health.Fhir.SqlServer.csproj b/src/Microsoft.Health.Fhir.SqlServer/Microsoft.Health.Fhir.SqlServer.csproj index 361ee5e9f9..3fe892074b 100644 --- a/src/Microsoft.Health.Fhir.SqlServer/Microsoft.Health.Fhir.SqlServer.csproj +++ b/src/Microsoft.Health.Fhir.SqlServer/Microsoft.Health.Fhir.SqlServer.csproj @@ -10,7 +10,7 @@ - + From a4b3bc7c456147f6639249d5d19317a42c4a4ab4 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Mon, 8 Apr 2024 12:12:29 -0700 Subject: [PATCH 130/149] Build component change --- .../Microsoft.Health.Fhir.SqlServer.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Health.Fhir.SqlServer/Microsoft.Health.Fhir.SqlServer.csproj b/src/Microsoft.Health.Fhir.SqlServer/Microsoft.Health.Fhir.SqlServer.csproj index 3fe892074b..d1b39787e7 100644 --- a/src/Microsoft.Health.Fhir.SqlServer/Microsoft.Health.Fhir.SqlServer.csproj +++ b/src/Microsoft.Health.Fhir.SqlServer/Microsoft.Health.Fhir.SqlServer.csproj @@ -13,7 +13,7 @@ - + From c1f13a90471a0f15c78d9f53bec638cd6d79a12d Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Tue, 23 Apr 2024 12:20:55 -0700 Subject: [PATCH 131/149] - remove unused reference in test integration project --- .../Persistence/SqlCustomQueryTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/test/Microsoft.Health.Fhir.Shared.Tests.Integration/Persistence/SqlCustomQueryTests.cs b/test/Microsoft.Health.Fhir.Shared.Tests.Integration/Persistence/SqlCustomQueryTests.cs index de22234693..9f7631c945 100644 --- a/test/Microsoft.Health.Fhir.Shared.Tests.Integration/Persistence/SqlCustomQueryTests.cs +++ b/test/Microsoft.Health.Fhir.Shared.Tests.Integration/Persistence/SqlCustomQueryTests.cs @@ -16,7 +16,6 @@ using Microsoft.Health.Fhir.Tests.Common; using Microsoft.Health.Fhir.Tests.Common.FixtureParameters; using Microsoft.Health.Test.Utilities; -using Microsoft.SqlServer.Management.Sdk.Sfc; using Xunit; using Xunit.Abstractions; using Xunit.Sdk; From ed71f79cc122770582e78849d7c089d8cfd4377b Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Thu, 25 Apr 2024 14:09:03 -0700 Subject: [PATCH 132/149] - Specify .net version for build and check version installed before building --- .github/actions/dotnet-build/action.yml | 4 ++++ .github/workflows/fhir-oss-ci-pipeline.yml | 3 +++ 2 files changed, 7 insertions(+) diff --git a/.github/actions/dotnet-build/action.yml b/.github/actions/dotnet-build/action.yml index b9127d813a..01d875b7e3 100644 --- a/.github/actions/dotnet-build/action.yml +++ b/.github/actions/dotnet-build/action.yml @@ -17,6 +17,10 @@ inputs: majorMinorPatch: description: The major.minor.patch version to use. required: true + dotnet-version: + description: 'The version of the .NET SDK to use' + required: true + default: '8.0.202' # Default version if not specified runs: using: composite steps: diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 6c85a8fdc8..e3117043a2 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -79,6 +79,9 @@ jobs: with: fetch-depth: 0 + - name: Check DotNet Version + run: dotnet --version + - name: Build uses: ./.github/actions/dotnet-build with: From 6731ccc8fc49e8500f08a0bc5ca3e5ac093c2c92 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Mon, 29 Apr 2024 09:53:15 -0700 Subject: [PATCH 133/149] - remove nobuild setting in dotnet test step to resolve error about files in use --- .github/actions/dotnet-test/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/dotnet-test/action.yml b/.github/actions/dotnet-test/action.yml index 26f17de674..118fb90a21 100644 --- a/.github/actions/dotnet-test/action.yml +++ b/.github/actions/dotnet-test/action.yml @@ -9,4 +9,4 @@ runs: steps: - name: Run Unit Tests shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --verbosity normal From c5e21a008718278e5ac8c14eb71c8a61572be4ae Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Fri, 3 May 2024 09:20:53 -0700 Subject: [PATCH 134/149] - attempt build and run unit tests with .net 8 only --- .github/actions/dotnet-test/action.yml | 2 +- .github/workflows/fhir-oss-ci-pipeline.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/dotnet-test/action.yml b/.github/actions/dotnet-test/action.yml index 118fb90a21..26f17de674 100644 --- a/.github/actions/dotnet-test/action.yml +++ b/.github/actions/dotnet-test/action.yml @@ -9,4 +9,4 @@ runs: steps: - name: Run Unit Tests shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index e3117043a2..b586c8bf36 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -47,7 +47,6 @@ jobs: with: global-json-file: 'global.json' dotnet-version: | - 6.x 8.x - name: Determine Semver From d48ebe1af58232a69ebc5026afd2bdb7fa40d489 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Fri, 3 May 2024 10:08:13 -0700 Subject: [PATCH 135/149] - run web and core unit tests separately to avoid resource contention --- .github/actions/dotnet-test-core/action.yml | 12 ++++++++++++ .../{dotnet-test => dotnet-test-web}/action.yml | 2 +- .github/workflows/fhir-oss-ci-pipeline.yml | 8 ++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 .github/actions/dotnet-test-core/action.yml rename .github/actions/{dotnet-test => dotnet-test-web}/action.yml (68%) diff --git a/.github/actions/dotnet-test-core/action.yml b/.github/actions/dotnet-test-core/action.yml new file mode 100644 index 0000000000..bf3fef1f6f --- /dev/null +++ b/.github/actions/dotnet-test-core/action.yml @@ -0,0 +1,12 @@ +name: dotnet test +description: 'Runs the unit tests for the Fhir solution' +inputs: + buildConfiguration: + description: 'The build configuration to use' + required: true +runs: + using: 'composite' + steps: + - name: Run Unit Tests + shell: bash + run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~Core.UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal diff --git a/.github/actions/dotnet-test/action.yml b/.github/actions/dotnet-test-web/action.yml similarity index 68% rename from .github/actions/dotnet-test/action.yml rename to .github/actions/dotnet-test-web/action.yml index 26f17de674..1d6f42ff06 100644 --- a/.github/actions/dotnet-test/action.yml +++ b/.github/actions/dotnet-test-web/action.yml @@ -9,4 +9,4 @@ runs: steps: - name: Run Unit Tests shell: bash - run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~Web.UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index b586c8bf36..30e3542060 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -89,8 +89,12 @@ jobs: fileVersion: ${{needs.setup.outputs.fileVersion}} informationalVersion: ${{needs.setup.outputs.informationalVersion}} majorMinorPatch: ${{needs.setup.outputs.majorMinorPatch}} - - name: Test - uses: ./.github/actions/dotnet-test + - name: TestCore + uses: ./.github/actions/dotnet-test-core + with: + buildConfiguration: ${{env.buildConfiguration}} + - name: TestWeb + uses: ./.github/actions/dotnet-test-web with: buildConfiguration: ${{env.buildConfiguration}} From c17605993495dfda83e845ae6929f2dabefde466 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sun, 5 May 2024 10:47:57 -0700 Subject: [PATCH 136/149] - try a simple build action workflow --- .github/workflows/simple-build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/simple-build.yml diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml new file mode 100644 index 0000000000..1c472e0c74 --- /dev/null +++ b/.github/workflows/simple-build.yml @@ -0,0 +1,22 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +on: + pull_request + +jobs: + build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + shell: bash + run: dotnet build "./Microsoft.Health.Fhir.sln" --no-restore From 7a946cd23aa0526b80df50593f6617169f3b8741 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sun, 5 May 2024 16:58:20 -0700 Subject: [PATCH 137/149] - adding unit tests to simple action workflow --- .github/workflows/simple-build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index 1c472e0c74..97afa3515e 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -20,3 +20,8 @@ jobs: - name: Build shell: bash run: dotnet build "./Microsoft.Health.Fhir.sln" --no-restore + # run: dotnet build "./Microsoft.Health.Fhir.sln" --configuration ${{inputs.buildConfiguration}} "-p:ContinuousIntegrationBuild=true;AssemblyVersion=${{inputs.assemblyVersion}};FileVersion=${{inputs.fileVersion}};InformationalVersion=${{inputs.informationalVersion}};Version=${{inputs.majorMinorPatch}}" -warnaserror + + - name: Test + run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~UnitTests" --verbosity normal + # run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~Core.UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal From 508b8bdf67ca7daf70bf08fac5044f01ec11c970 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sun, 5 May 2024 18:06:45 -0700 Subject: [PATCH 138/149] - run unit tests separately --- .github/workflows/simple-build.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index 97afa3515e..d6ccc4fced 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -5,7 +5,7 @@ on: pull_request jobs: - build: + buildAndUnitTests: runs-on: windows-latest @@ -22,6 +22,27 @@ jobs: run: dotnet build "./Microsoft.Health.Fhir.sln" --no-restore # run: dotnet build "./Microsoft.Health.Fhir.sln" --configuration ${{inputs.buildConfiguration}} "-p:ContinuousIntegrationBuild=true;AssemblyVersion=${{inputs.assemblyVersion}};FileVersion=${{inputs.fileVersion}};InformationalVersion=${{inputs.informationalVersion}};Version=${{inputs.majorMinorPatch}}" -warnaserror - - name: Test - run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~UnitTests" --verbosity normal + - name: Test Azure.UnitTests + run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~Azure.UnitTests" --verbosity normal # run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~Core.UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + + - name: Test Core.UnitTests + run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~Core.UnitTests" --verbosity normal + + - name: Test CosmosDb.UnitTests + run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~CosmosDb.UnitTests" --verbosity normal + + - name: Test Api.UnitTests + run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~Api.UnitTests" --verbosity normal + + - name: Test Web.UnitTests + run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~Web.UnitTests" --verbosity normal + + - name: Test SchemaManager.UnitTests + run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~SchemaManager.UnitTests" --verbosity normal + + - name: Test SqlServer.UnitTests + run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~SqlServer.UnitTests" --verbosity normal + + - name: Test TaskManagement.UnitTests + run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~TaskManagement.UnitTests" --verbosity normal From 9f9292d8da1ae2bc8de40a605e7be80ec00847be Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sat, 11 May 2024 10:24:24 -0700 Subject: [PATCH 139/149] Revert "- run unit tests separately" This reverts commit 508b8bdf67ca7daf70bf08fac5044f01ec11c970. --- .github/workflows/simple-build.yml | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index d6ccc4fced..97afa3515e 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -5,7 +5,7 @@ on: pull_request jobs: - buildAndUnitTests: + build: runs-on: windows-latest @@ -22,27 +22,6 @@ jobs: run: dotnet build "./Microsoft.Health.Fhir.sln" --no-restore # run: dotnet build "./Microsoft.Health.Fhir.sln" --configuration ${{inputs.buildConfiguration}} "-p:ContinuousIntegrationBuild=true;AssemblyVersion=${{inputs.assemblyVersion}};FileVersion=${{inputs.fileVersion}};InformationalVersion=${{inputs.informationalVersion}};Version=${{inputs.majorMinorPatch}}" -warnaserror - - name: Test Azure.UnitTests - run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~Azure.UnitTests" --verbosity normal + - name: Test + run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~UnitTests" --verbosity normal # run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~Core.UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal - - - name: Test Core.UnitTests - run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~Core.UnitTests" --verbosity normal - - - name: Test CosmosDb.UnitTests - run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~CosmosDb.UnitTests" --verbosity normal - - - name: Test Api.UnitTests - run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~Api.UnitTests" --verbosity normal - - - name: Test Web.UnitTests - run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~Web.UnitTests" --verbosity normal - - - name: Test SchemaManager.UnitTests - run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~SchemaManager.UnitTests" --verbosity normal - - - name: Test SqlServer.UnitTests - run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~SqlServer.UnitTests" --verbosity normal - - - name: Test TaskManagement.UnitTests - run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~TaskManagement.UnitTests" --verbosity normal From a23f880b4316e2d5908cb2433da6399f44ef6023 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sat, 11 May 2024 10:47:14 -0700 Subject: [PATCH 140/149] - add create package step --- .github/workflows/simple-build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index 97afa3515e..279fca8d14 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -5,7 +5,7 @@ on: pull_request jobs: - build: + buildTestAndPackage: runs-on: windows-latest @@ -15,8 +15,10 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x + - name: Restore dependencies run: dotnet restore + - name: Build shell: bash run: dotnet build "./Microsoft.Health.Fhir.sln" --no-restore @@ -25,3 +27,10 @@ jobs: - name: Test run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~UnitTests" --verbosity normal # run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~Core.UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + + - name: Create Nuget packages + run: | + echo "Creating Nuget packages" + dotnet pack -c Release --no-build --output + # dotnet pack ${{github.workspace}}\Microsoft.Health.Fhir.sln --output ${{env.outputPath}}/nupkgs --no-build --configuration=${{env.buildConfiguration}} -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} + From 565832e99b1d054200984bc0a396f7bd69aa7e92 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sun, 12 May 2024 09:18:44 -0700 Subject: [PATCH 141/149] - update output path for nuget packages --- .github/workflows/simple-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index 279fca8d14..6d72b2ea7b 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -31,6 +31,6 @@ jobs: - name: Create Nuget packages run: | echo "Creating Nuget packages" - dotnet pack -c Release --no-build --output + dotnet pack -c Release --no-build --output ./nupkgs # dotnet pack ${{github.workspace}}\Microsoft.Health.Fhir.sln --output ${{env.outputPath}}/nupkgs --no-build --configuration=${{env.buildConfiguration}} -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} From 2cafa5df376f3bc1c37f3f099db45cf9948c6b1c Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sun, 12 May 2024 16:16:29 -0700 Subject: [PATCH 142/149] - add env variables, update package job --- .github/workflows/simple-build.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index 6d72b2ea7b..836f0f2a0a 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -4,6 +4,16 @@ on: pull_request +env: + buildConfiguration: Release + azureSubscriptionEndpoint: docker-build + azureContainerRegistryName: healthplatformregistry + connectedServiceName: Microsoft Health Open Source Subscription + composeLocation: build/docker/docker-compose.yaml + imageTag: ${{github.run_number}} + outputPath: ${{github.workspace}}/artifacts + defaultDotNetVersion: net8.0 + jobs: buildTestAndPackage: @@ -31,6 +41,6 @@ jobs: - name: Create Nuget packages run: | echo "Creating Nuget packages" - dotnet pack -c Release --no-build --output ./nupkgs + dotnet pack ${{github.workspace}}\Microsoft.Health.Fhir.sln --output ${{env.outputPath}}/nupkgs --no-build -c Release # dotnet pack ${{github.workspace}}\Microsoft.Health.Fhir.sln --output ${{env.outputPath}}/nupkgs --no-build --configuration=${{env.buildConfiguration}} -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} From bf62b90a75284244189e84cba5d9e2271383f256 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sun, 12 May 2024 21:58:33 -0700 Subject: [PATCH 143/149] - comment out tests to try package step --- .github/workflows/simple-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index 836f0f2a0a..a6b63a2b07 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -34,9 +34,9 @@ jobs: run: dotnet build "./Microsoft.Health.Fhir.sln" --no-restore # run: dotnet build "./Microsoft.Health.Fhir.sln" --configuration ${{inputs.buildConfiguration}} "-p:ContinuousIntegrationBuild=true;AssemblyVersion=${{inputs.assemblyVersion}};FileVersion=${{inputs.fileVersion}};InformationalVersion=${{inputs.informationalVersion}};Version=${{inputs.majorMinorPatch}}" -warnaserror - - name: Test - run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~UnitTests" --verbosity normal - # run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~Core.UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal + # - name: Test + # run: dotnet test "Microsoft.Health.Fhir.sln" --no-build --filter "FullyQualifiedName~UnitTests" --verbosity normal + # # run: dotnet test "Microsoft.Health.Fhir.sln" -p:ContinuousIntegrationBuild=true; --filter "FullyQualifiedName~Core.UnitTests" --configuration ${{inputs.buildConfiguration}} --no-build --verbosity normal - name: Create Nuget packages run: | From ac3ba59f7f6c0ce6a843066732393dceb4268174 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Mon, 13 May 2024 11:46:05 -0700 Subject: [PATCH 144/149] - adding upload nuget packages step --- .github/workflows/simple-build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index a6b63a2b07..ac7e546e7f 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -44,3 +44,8 @@ jobs: dotnet pack ${{github.workspace}}\Microsoft.Health.Fhir.sln --output ${{env.outputPath}}/nupkgs --no-build -c Release # dotnet pack ${{github.workspace}}\Microsoft.Health.Fhir.sln --output ${{env.outputPath}}/nupkgs --no-build --configuration=${{env.buildConfiguration}} -p:PackageVersion=${{needs.setup.outputs.majorMinorPatch}} + - name: Upload Nuget Packages + uses: actions/upload-artifact@v4 + with: + name: nuget + path: ${{env.outputPath}}/nupkgs From ad59f56fb0618e414c47d4d4e244695721c474ee Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Thu, 16 May 2024 14:08:34 -0700 Subject: [PATCH 145/149] - add step to login to Azure, build docker image and push to acr --- .github/workflows/simple-build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index ac7e546e7f..341f380ad6 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -49,3 +49,13 @@ jobs: with: name: nuget path: ${{env.outputPath}}/nupkgs + + - name: Login to Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Build Docker image + run: | + docker build -t myregistry.azurecr.io/myimage:${{ github.sha }} . + docker push myregistry.azurecr.io/myimage:${{ github.sha }} From cefd58fe6cba45ac43ef371afdeba3dda43ab638 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sun, 19 May 2024 11:56:39 -0700 Subject: [PATCH 146/149] - remove default build version --- .github/workflows/simple-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index 341f380ad6..a3c0d1ae50 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -12,7 +12,7 @@ env: composeLocation: build/docker/docker-compose.yaml imageTag: ${{github.run_number}} outputPath: ${{github.workspace}}/artifacts - defaultDotNetVersion: net8.0 + # defaultDotNetVersion: net8.0 jobs: buildTestAndPackage: @@ -54,6 +54,8 @@ jobs: uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} + #what is the compliant way to use secrets in github actions, look at + # https://docs.opensource.microsoft.com/ - name: Build Docker image run: | From 7333e900fc2c5acf73ccce8c83ec0c0b140a13c4 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sun, 19 May 2024 12:24:17 -0700 Subject: [PATCH 147/149] - update build to use .net 8.0.205 --- .github/workflows/simple-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index a3c0d1ae50..bdf849fb33 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -12,7 +12,7 @@ env: composeLocation: build/docker/docker-compose.yaml imageTag: ${{github.run_number}} outputPath: ${{github.workspace}}/artifacts - # defaultDotNetVersion: net8.0 + defaultDotNetVersion: net8.0.205 jobs: buildTestAndPackage: From a8862c92172413a7fab7c07e876632a157c7a618 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sun, 19 May 2024 12:53:46 -0700 Subject: [PATCH 148/149] - set .net build to 8.0.204 --- .github/workflows/simple-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index bdf849fb33..f0e3382193 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -12,7 +12,7 @@ env: composeLocation: build/docker/docker-compose.yaml imageTag: ${{github.run_number}} outputPath: ${{github.workspace}}/artifacts - defaultDotNetVersion: net8.0.205 + defaultDotNetVersion: net8.0.204 jobs: buildTestAndPackage: From 8d473281c18d9d3929fb524847eca35ea10312c6 Mon Sep 17 00:00:00 2001 From: "Nathan Lemma (Waferwire LLC)" Date: Sun, 19 May 2024 13:12:06 -0700 Subject: [PATCH 149/149] - specify .net build version to 8.0.204 --- .github/workflows/simple-build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/simple-build.yml b/.github/workflows/simple-build.yml index f0e3382193..8be0c7b84c 100644 --- a/.github/workflows/simple-build.yml +++ b/.github/workflows/simple-build.yml @@ -12,7 +12,6 @@ env: composeLocation: build/docker/docker-compose.yaml imageTag: ${{github.run_number}} outputPath: ${{github.workspace}}/artifacts - defaultDotNetVersion: net8.0.204 jobs: buildTestAndPackage: @@ -24,7 +23,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 8.0.204 - name: Restore dependencies run: dotnet restore