InitDev Postgres, Smoke Tests #2853
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: InitDev Postgres, Smoke Tests | |
on: | |
pull_request: | |
branches: | |
- main-6x | |
paths: | |
- Application/**/* | |
push: | |
branches: | |
- main-6x | |
paths: | |
- Application/**/* | |
workflow_dispatch: | |
inputs: | |
distinct_id: | |
description: 'distinct ID for Trgr InitDev workflows in Implementation repo workflow' | |
required: false | |
default: 'distinct_id' | |
repository_dispatch: | |
types: [triggered-from-ods-repo] | |
env: | |
INFORMATIONAL_VERSION: "6.2" | |
BUILD_INCREMENTER: "1" | |
CONFIGURATION: "Release" | |
VERSION_MAJOR: "6" | |
VERSION_MINOR: "2" | |
HEAD_REF: ${{ GITHUB.HEAD_REF }} | |
REF_NAME: ${{ GITHUB.REF_NAME }} | |
REPOSITORY_DISPATCH_BRANCH: ${{ github.event.client_payload.branch }} | |
EDFI_SUITE_NUMBER: "Suite3" | |
msbuild_buildConfiguration: "release" | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: echo distinct ID ${{ github.event.inputs.distinct_id }} | |
run: echo "${{ github.event.inputs.distinct_id }}" | |
- name: Support longpaths | |
run: git config --system core.longpaths true | |
- name: Checkout Ed-Fi-ODS-Implementation | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Implementation | |
path: Ed-Fi-ODS-Implementation/ | |
- name: Is pull request branch exists in Ed-Fi-ODS-Implementation | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
shell: pwsh | |
run: | | |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "." | |
- name: Checkout Ed-Fi-ODS | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS | |
path: Ed-Fi-ODS/ | |
ref: ${{ github.head_ref }} | |
- name: Is pull request branch exists in Ed-Fi-ODS | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
shell: pwsh | |
run: | | |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "../Ed-Fi-ODS" | |
- name: Install & Start PostgreSQL 13 | |
run: | | |
choco install postgresql13 --params '/Password:postgres' | |
$confPath = "C:\Program Files\PostgreSQL\13\data\pg_hba.conf" | |
(Get-Content $confPath).Replace("scram-sha-256","trust") | Set-Content $confPath | |
Restart-Service postgresql-x64-13 | |
- name: ODS/API InitDev and SdkGen | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
run: | | |
$ErrorActionPreference = 'Stop' | |
[int]$BuildCounter = "${{ github.run_number }}" | |
[int]$BuildIncrementer = "${{ env.BUILD_INCREMENTER }}" | |
[int]$newRevision = $BuildCounter + $BuildIncrementer | |
[string]$version = "${{ env.VERSION_MAJOR}}"+ "." +"${{ env.VERSION_MINOR}}" + "." + $newRevision.ToString() | |
.\build.github.ps1 -Engine PostgreSQL -PackageVersion $version -RepositoryRoot $env:GITHUB_WORKSPACE -UsePlugins -RunSdkGen -GenerateTestSdkPackage -NoPackaging -JavaPath $env:JAVA_HOME_11_X64\bin\java.exe | |
shell: pwsh | |
- name: Upload initdev logs | |
if: success() || failure() | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 | |
with: | |
name: Initdev logs | |
path: | | |
${{ github.workspace }}/Ed-Fi-ODS-Implementation/Application/EdFi.Ods.Api.IntegrationTestHarness/bin/**/PostmanIntegrationTestsLog.log | |
${{ github.workspace }}/Ed-Fi-ODS-Implementation/Application/EdFi.Ods.Api.IntegrationTestHarness/bin/**/*TestHarnessLog.log | |
- name: ODS/API Smoke Test Sandbox | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
run: | | |
$ErrorActionPreference = 'Stop' | |
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1 | |
Reset-TestPopulatedTemplateDatabase | |
$params = @{ | |
InstallType = 'Sandbox' | |
Engine = 'PostgreSQL' | |
DropDatabases = $true | |
NoDuration = $true | |
UsePlugins = $true | |
} | |
Initialize-DeploymentEnvironment @params | |
if(Test-Path $env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/DataLoading/EdFi.SmokeTest.Console/bin/Release/net8.0/publish) { | |
Remove-Item -Path $env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/DataLoading/EdFi.SmokeTest.Console/bin/Release/net8.0/publish -Recurse | |
} | |
$params = @{ | |
testSets = @("NonDestructiveApi", "NonDestructiveSdk", "DestructiveSdk") | |
smokeTestDll = "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/SdkGen/EdFi.SdkGen.Console/csharp/src/EdFi.OdsApi.Sdk/bin/Release/net8.0/EdFi.OdsApi.Sdk.dll" | |
testHarnessLogNamePrefix = "SmokeTestSandbox" | |
} | |
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/logistics/scripts/run-smoke-tests.ps1 @params | |
shell: pwsh | |
- name: Upload Smoke Test Sandbox Logs | |
if: success() || failure() | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 | |
with: | |
name: Smoke Test Sandbox Logs | |
path: | | |
${{ github.workspace }}/Ed-Fi-ODS/Utilities/DataLoading/EdFi.SmokeTest.Console/bin/**/EdFi.SmokeTest.log | |
${{ github.workspace }}/Ed-Fi-ODS-Implementation/Application/EdFi.Ods.Api.IntegrationTestHarness/bin/**/SmokeTestSandbox.TestHarnessLog.log | |
- name: ODS/API Smoke Test YearSpecific | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
run: | | |
$ErrorActionPreference = 'Stop' | |
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1 | |
Reset-TestPopulatedTemplateDatabase | |
$params = @{ | |
InstallType = 'YearSpecific' | |
Engine = 'PostgreSQL' | |
OdsTokens = '2022' | |
DropDatabases = $true | |
NoDuration = $true | |
UsePlugins = $true | |
} | |
Initialize-DeploymentEnvironment @params | |
$params = @{ | |
schoolYear = "2022" | |
testSets = @("NonDestructiveApi", "NonDestructiveSdk", "DestructiveSdk") | |
smokeTestDll = "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/SdkGen/EdFi.SdkGen.Console/csharp/src/EdFi.OdsApi.Sdk/bin/Release/net8.0/EdFi.OdsApi.Sdk.dll" | |
testHarnessLogNamePrefix = "SmokeTestYearSpecific" | |
} | |
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/logistics/scripts/run-smoke-tests.ps1 @params | |
shell: pwsh | |
- name: Upload Smoke Test YearSpecific Logs | |
if: success() || failure() | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 | |
with: | |
name: Smoke Test YearSpecific Logs | |
path: | | |
${{ github.workspace }}/Ed-Fi-ODS/Utilities/DataLoading/EdFi.SmokeTest.Console/bin/**/EdFi.SmokeTest.log | |
${{ github.workspace }}/Ed-Fi-ODS-Implementation/Application/EdFi.Ods.Api.IntegrationTestHarness/bin/**/SmokeTestYearSpecific.TestHarnessLog.log | |
- name: ODS/API Smoke Test Shared Instance | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
run: | | |
$ErrorActionPreference = 'Stop' | |
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1 | |
Reset-TestPopulatedTemplateDatabase | |
$params = @{ | |
InstallType = 'SharedInstance' | |
Engine = 'PostgreSQL' | |
DropDatabases = $true | |
NoDuration = $true | |
UsePlugins = $true | |
} | |
Initialize-DeploymentEnvironment @params | |
$params = @{ | |
testSets = @("NonDestructiveApi", "NonDestructiveSdk", "DestructiveSdk") | |
smokeTestDll = "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/SdkGen/EdFi.SdkGen.Console/csharp/src/EdFi.OdsApi.Sdk/bin/Release/net8.0/EdFi.OdsApi.Sdk.dll" | |
testHarnessLogNamePrefix = "SmokeTestSharedInstance" | |
} | |
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/logistics/scripts/run-smoke-tests.ps1 @params | |
shell: pwsh | |
- name: Upload Smoke Test Shared Instance Logs | |
if: success() || failure() | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 | |
with: | |
name: Smoke Test Shared Instance Logs | |
path: | | |
${{ github.workspace }}/Ed-Fi-ODS/Utilities/DataLoading/EdFi.SmokeTest.Console/bin/**/EdFi.SmokeTest.log | |
${{ github.workspace }}/Ed-Fi-ODS-Implementation/Application/EdFi.Ods.Api.IntegrationTestHarness/bin/**/SmokeTestSharedInstance.TestHarnessLog.log |