InitDev, Smoke Tests #4552
This file contains hidden or 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, Smoke Tests | |
run-name: ${{github.event.client_payload.branch}} | |
on: | |
pull_request: | |
branches: [main, 'b-v*-patch*','feature-*'] | |
push: | |
branches: [main, 'b-v*-patch*','feature-*'] | |
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] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
INFORMATIONAL_VERSION: "7.2" | |
BUILD_INCREMENTER: "-1706" | |
CONFIGURATION: "Release" | |
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: | |
FindStandardAndExtensionVersions: | |
uses: Ed-Fi-Alliance-OSS/Ed-Fi-ODS/.github/workflows/Find Standard and Extension Versions.yml@874b608a0f3a14243e0035dd1222169fafcbe8d3 | |
with: | |
calling_branch: ${{ github.head_ref || github.ref_name }} | |
build: | |
if: ${{ always() }} | |
needs: FindStandardAndExtensionVersions | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
StandardVersion: ${{ fromJson(needs.FindStandardAndExtensionVersions.outputs.StandardVersions) }} | |
ExtensionVersion: ${{ fromJson(needs.FindStandardAndExtensionVersions.outputs.ExtensionVersions) }} | |
name: build (Standard Version ${{ matrix.StandardVersion }}) | |
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
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: powershell | |
run: | | |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "." | |
- name: Checkout Ed-Fi-ODS | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS | |
path: Ed-Fi-ODS/ | |
- name: Is pull request branch exists in Ed-Fi-ODS | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
shell: powershell | |
run: | | |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "../Ed-Fi-ODS" | |
- name: update BUILD_INCREMENTER | |
run: | | |
$newRevision = ([int]${{ github.run_number }}) + ([int]${{env.BUILD_INCREMENTER}}) | |
if ($newRevision -lt 0) { | |
$newRevision = 1 | |
echo "BUILD_INCREMENTER=$newRevision">> $env:GITHUB_ENV | |
} | |
shell: powershell | |
- name: Cache Nuget packages | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj*', '**/configuration.packages.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
${{ runner.os }}- | |
nuget- | |
enableCrossOsArchive: true | |
- name: Restore NuGet packages | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
run: | | |
.\build.githubactions.ps1 restore -Solution "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/SdkGen/EdFi.SdkGen.sln" | |
.\build.githubactions.ps1 restore -Solution "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Application/Ed-Fi-Ods.sln" | |
.\build.githubactions.ps1 restore -Solution "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/DataLoading/LoadTools.sln" | |
shell: powershell | |
- name: Install sql-server-2019 & sqlpackage | |
shell: powershell | |
run: | | |
choco install sql-server-2019 -y --params "'/IGNOREPENDINGREBOOT /IACCEPTSQLSERVERLICENSETERMS /Q /ACTION=install /INSTANCEID=MSSQLSERVER /INSTANCENAME=MSSQLSERVER /TCPENABLED=1 /UPDATEENABLED=FALSE /FEATURES=SQL,Tools'" --execution-timeout=$installTimeout | |
choco install sqlpackage | |
- 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.INFORMATIONAL_VERSION}}"+ "."+ $newRevision.ToString() | |
.\build.github.ps1 -PackageVersion $version -RepositoryRoot $env:GITHUB_WORKSPACE -UsePlugins -RunSdkGen -GenerateTestSdkPackage -PackageOutput "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/NugetPackages" -NoPackaging -NoRestore -StandardVersion ${{ matrix.StandardVersion }} -ExtensionVersion ${{ matrix.ExtensionVersion }} -JavaPath $env:JAVA_HOME_11_X64\bin\java.exe | |
shell: powershell | |
- name: Upload initdev logs | |
if: success() || failure() | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 | |
with: | |
name: Initdev logs-${{ matrix.StandardVersion }} | |
path: | | |
${{ github.workspace }}/Ed-Fi-ODS-Implementation/Application/EdFi.Ods.Api.IntegrationTestHarness/bin/**/*TestHarnessLog.log | |
- name: Run Unit tests for EdFi.LoadTools | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
run: | | |
.\build.githubactions.ps1 Restore -Solution "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/DataLoading/LoadTools.sln" | |
.\build.githubactions.ps1 Build -Solution "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/DataLoading/LoadTools.sln" | |
.\build.githubactions.ps1 Test -Configuration ${{ env.CONFIGURATION }} -Solution "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/DataLoading/LoadTools.sln" -TestFilter "RunManually" | |
shell: powershell | |
- 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 = 'SQLServer' | |
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: powershell | |
- name: Upload Smoke Test Sandbox Logs | |
if: success() || failure() | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 | |
with: | |
name: Smoke Test Sandbox Logs-${{ matrix.StandardVersion }} | |
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: Upload EdFi.Ods.Api.TestSdk NugetPackage | |
if: success() | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 | |
with: | |
name: NugetPackages.Artifacts-${{ matrix.StandardVersion }} | |
path: ${{ github.workspace }}/Ed-Fi-ODS-Implementation/NugetPackages/*TestSdk*.nupkg |