Skip to content

Added a Notification feature, a Services section (to hold configurati… #1

Added a Notification feature, a Services section (to hold configurati…

Added a Notification feature, a Services section (to hold configurati… #1

# 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, MultiTenancy
run-name: ${{github.event.client_payload.branch}}
on:
pull_request:
branches: [main, 'ODS-*',b-v*-patch*]
push:
branches: [main, 'ODS-*',b-v*-patch*]
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: "7.1"
BUILD_INCREMENTER: "1"
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:
FindStandardVersions:
runs-on: ubuntu-latest
outputs:
StandardVersions: ${{ steps.Set_StandardVersions.outputs.StandardVersions }}
steps:
- 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: Checkout Ed-Fi-ODS
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
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: pwsh
run: |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "../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" | Out-String
echo "StandardVersions=$output" >> $env:GITHUB_OUTPUT
Write-host "StandardVersions is $output"
shell: pwsh
build:
if: ${{ always() }}
needs: FindStandardVersions
runs-on: windows-latest
strategy:
matrix:
StandardVersion: ${{ fromJson(needs.FindStandardVersions.outputs.StandardVersions) }}
name: build (Standard Version ${{ matrix.StandardVersion }})
steps:
- name: echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo "${{ github.event.inputs.distinct_id }}"
- name: Setup .NET
uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8 # 2.1.0
with:
dotnet-version: 6.0.x
- name: Support longpaths
run: git config --system core.longpaths true
- 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: 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@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
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: Cache Nuget packages
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 #v3.2.3
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 }}
shell: powershell
- name: Upload initdev logs
if: success() || failure()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: MultiTenant 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 MultiTenancy Smoke Tests
working-directory: ./Ed-Fi-ODS-Implementation/
run: |
$ErrorActionPreference = 'Stop'
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1
.\build.github.ps1 -InstallType MultiTenant -Tenants "Tenant1;Tenant2" -RepositoryRoot $env:GITHUB_WORKSPACE -UsePlugins -NoPackaging -NoRestore -StandardVersion ${{ matrix.StandardVersion }}
if(Test-Path $env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/DataLoading/EdFi.SmokeTest.Console/bin/Release/net6.0/publish) {
Remove-Item -Path $env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/DataLoading/EdFi.SmokeTest.Console/bin/Release/net6.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/net6.0/EdFi.OdsApi.Sdk.dll"
testHarnessLogNamePrefix = "SmokeTestSandbox"
apiUrl = "http://localhost:8765/Tenant1"
isMultiTenancy = $true
}
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/logistics/scripts/run-smoke-tests.ps1 @params
shell: powershell
- name: Upload MultiTenancy Smoke Tests Logs
if: success() || failure()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: MultiTenant Smoke Tests 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 Postman Test MultiTenancy
working-directory: ./Ed-Fi-ODS-Implementation/
run: |
$ErrorActionPreference = 'Stop'
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1
Reset-TestAdminDatabase
Reset-TestSecurityDatabase
Reset-TestPopulatedTemplateDatabase
Write-FlatHashtable (Get-DeploymentSettings)
./logistics/scripts/Invoke-PostmanIntegrationTests.ps1 -isMultiTenancy -configurationFile "./logistics/scripts/modules/postmanTestHarnessConfiguration-Multitenancy.json"
shell: powershell
- name: Postman MultiTenancy Test Report
uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 # v1.6
if: success() || failure()
with:
name: MultiTenant Postman Tests
path: ${{ github.workspace }}/Ed-Fi-ODS-Implementation/reports/*.xml
path-replace-backslashes: 'true'
working-directory: ${{ github.workspace }}/Ed-Fi-ODS-Implementation
reporter: java-junit