Skip to content

[ODS-6570] Nhibernate Upgrade for 7.1 and 7.2 (#1190) #1250

[ODS-6570] Nhibernate Upgrade for 7.1 and 7.2 (#1190)

[ODS-6570] Nhibernate Upgrade for 7.1 and 7.2 (#1190) #1250

# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
name: Pkg EdFi.Ods.Populated.Template.PostgreSQL
on:
push:
branches:
[main, 'ODS-*',b-v*-patch*]
workflow_dispatch:
inputs:
distinct_id:
description: 'distinct ID for Rebuild Database Templates workflow'
required: false
default: 'distinct_id'
env:
INFORMATIONAL_VERSION: "7.1"
BUILD_INCREMENTER: "-553"
AZURE_ARTIFACT_URL: "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
AZURE_ARTIFACT_NUGET_KEY: ${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS : '{"endpointCredentials": [{"endpoint": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json","password": "${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}"}]}'
CONFIGURATION: "Release"
REPOSITORY_DISPATCH_BRANCH: ${{ github.event.client_payload.branch }}
HEAD_REF: ${{ GITHUB.HEAD_REF }}
REF_NAME: ${{ GITHUB.REF_NAME }}
REPOSITORY_OWNER: ${{ GITHUB.REPOSITORY_OWNER }}
jobs:
FindStandardVersions:
runs-on: ubuntu-latest
outputs:
StandardVersions: ${{ steps.Set_StandardVersions.outputs.StandardVersions }}
steps:
- name: Checkout Ed-Fi-ODS
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
path: Ed-Fi-ODS/
- name: Set StandardVersions
id: Set_StandardVersions
working-directory: ./Ed-Fi-ODS/
run: |
$output = .\build.githubactions.ps1 StandardVersions -ProjectFile "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Application/EdFi.Ods.Standard/EdFi.Ods.Standard.csproj"
echo "StandardVersions=$output" >> $env:GITHUB_OUTPUT
Write-host "StandardVersions is $output"
shell: pwsh
build:
if: ${{ always() }}
needs: FindStandardVersions
runs-on: ubuntu-latest
strategy:
matrix:
StandardVersion: ${{ fromJson(needs.FindStandardVersions.outputs.StandardVersions) }}
name: build (Standard Version ${{ matrix.StandardVersion }})
services:
postgres:
image: postgres:13
env:
POSTGRES_HOST_AUTH_METHOD: trust
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo "${{ github.event.inputs.distinct_id }}"
- name: Check for Azure token
if: ${{ env.REPOSITORY_OWNER == 'Ed-Fi-Alliance-OSS' && env.AZURE_ARTIFACT_NUGET_KEY == '' }}
run: |
echo "::error::Missing Azure Token"
exit 1
- name: Setup .NET
uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8 # 2.1.0
with:
dotnet-version: 6.0.x
- name: Checkout Ed-Fi-ODS
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
path: Ed-Fi-ODS/
- name: Checkout Ed-Fi-ODS-Implementation
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Implementation
path: Ed-Fi-ODS-Implementation/
- name: Set Ed-Fi-Standard Reference
working-directory: ./Ed-Fi-ODS/
run: |
$standardTag = .\build.githubactions.ps1 StandardTag -standardVersion ${{ matrix.StandardVersion }} -ProjectFile "./Application/EdFi.Ods.Standard/EdFi.Ods.Standard.csproj"
echo "EDFI_STANDARD_REFERENCE=$standardTag">> $env:GITHUB_ENV
Write-host "Ed-Fi-Standard Tag is $standardTag"
shell: pwsh
- name: Checkout Ed-Fi-ODS-Standard
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-Standard
path: Ed-Fi-Standard/
ref: ${{ env.EDFI_STANDARD_REFERENCE }}
- name: Is pull request branch exists in Ed-Fi-ODS-Implementation
working-directory: ./Ed-Fi-ODS/
shell: pwsh
run: |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "../Ed-Fi-ODS-Implementation"
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj*', '**/configuration.packages.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore NuGet packages
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 restore -Solution "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Application/Ed-Fi-Ods.sln"
shell: pwsh
- name: Initialize-DevelopmentEnvironment
working-directory: ./Ed-Fi-ODS-Implementation/
run: |
$ErrorActionPreference = 'Stop'
[Environment]::SetEnvironmentVariable('msbuild_buildConfiguration', '${{ env.CONFIGURATION }}')
$PSVersionTable
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1
Initialize-DevelopmentEnvironment -NoDeploy -Engine PostgreSQL -NoRestore -StandardVersion ${{ matrix.StandardVersion }}
shell: pwsh
- name: Remove Plug-Ins
working-directory: ./Ed-Fi-ODS-Implementation/
run: |
$ErrorActionPreference = 'Stop'
rm -R ./Plugin/Extensions.*
shell: pwsh
- name: Create Database Template (no extensions)
working-directory: ./
run: |
$ErrorActionPreference = 'Stop'
[Environment]::SetEnvironmentVariable('msbuild_buildConfiguration', '${{ env.CONFIGURATION }}')
Import-Module -Force -Scope Global "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/DatabaseTemplate/Modules/create-populated-template.psm1"
Initialize-PopulatedTemplate -samplePath "./Ed-Fi-Standard/" -noExtensions -Engine PostgreSQL -standardVersion ${{ matrix.StandardVersion }}
shell: pwsh
- name: pack
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 pack -Configuration ${{ env.CONFIGURATION }} -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -NuspecFilePath "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/DatabaseTemplate/Database/EdFi.Ods.Populated.Template.PostgreSQL.Standard.${{ matrix.StandardVersion }}.nuspec" -PackageName "EdFi.Suite3.Ods.Populated.Template.PostgreSQL.Standard.${{ matrix.StandardVersion }}"
shell: pwsh
- name: Install-credential-handler
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 InstallCredentialHandler
shell: pwsh
- name: publish
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' }}
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 publish -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -NuGetApiKey ${{ env.AZURE_ARTIFACT_NUGET_KEY }} -EdFiNuGetFeed ${{env.AZURE_ARTIFACT_URL}} -PackageName "EdFi.Suite3.Ods.Populated.Template.PostgreSQL.Standard.${{ matrix.StandardVersion }}"
shell: pwsh
- name: Upload EdFi.Ods.Populated.Template Artifacts
if: success() || failure()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: NugetPackages.Artifacts
path: ${{ github.workspace }}/Ed-Fi-ODS/NugetPackages/EdFi.Suite3.Ods.Populated.Template.PostgreSQL*.nupkg
- name: Move Log Files
run: |
$bulkLoadClientSourcePath = "${{ github.workspace }}/Ed-Fi-ODS/Utilities/DataLoading/EdFi.BulkLoadClient.Console/bin/${{ env.CONFIGURATION }}/net6.0/logfile.txt"
$testHarnessSourcePath = "${{ github.workspace }}/Ed-Fi-ODS-Implementation/Application/EdFi.Ods.Api.IntegrationTestHarness/bin/${{ env.CONFIGURATION }}/net6.0/TestHarnessLog.log"
$testHarnessRequestResponseDetailsSourcePath = "${{ github.workspace }}/Ed-Fi-ODS-Implementation/Application/EdFi.Ods.Api.IntegrationTestHarness/bin/${{ env.CONFIGURATION }}/net6.0/TestHarnessRequestResponseDetailsLog.log"
$destinationPath = "${{ github.workspace }}/CreateDatabaseTemplateLogs/"
# Create the destination folder if it doesn't exist
if (!(Test-Path -Path $destinationPath)) {
New-Item -ItemType Directory -Path $destinationPath -Force
}
# Move the files
Move-Item -Path $bulkLoadClientSourcePath -Destination $destinationPath -Force
Move-Item -Path $testHarnessSourcePath -Destination $destinationPath -Force
Move-Item -Path $testHarnessRequestResponseDetailsSourcePath -Destination $destinationPath -Force
shell: pwsh
- name: Upload Create Database Template Logs
if: success() || failure()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: Create Database Template Logs
path: |
${{ github.workspace }}/CreateDatabaseTemplateLogs/*.*