Skip to content

[BIA-1351] Update AMT to .NET 8 and Latest Packages (#243) #458

[BIA-1351] Update AMT to .NET 8 and Latest Packages (#243)

[BIA-1351] Update AMT to .NET 8 and Latest Packages (#243) #458

Workflow file for this run

# 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: .NET Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
CONFIGURATION: "Release"
GA_USE_GITHUB_ENV: "true"
USE_MSSQL_DEFAULT_CONN_STRING: "FALSE"
USE_POSTGRES_DEFAULT_CONN_STRING: "FALSE"
SQLSERVER_SERVER: "localhost"
SQLSERVER_ADMIN_USER: "sa"
SQLSERVER_ADMIN_PASS: ${{ secrets.MSSQL_SA_PWD }}
SQLSERVER_DATABASE_DS2: "AnalyticsMiddleTier_Testing_Ds2"
SQLSERVER_DATABASE_DS31: "AnalyticsMiddleTier_Testing_Ds31"
SQLSERVER_DATABASE_DS32: "AnalyticsMiddleTier_Testing_Ds32"
SQLSERVER_DATABASE_DS33: "AnalyticsMiddleTier_Testing_Ds33"
SQLSERVER_DATABASE_DS40: "AnalyticsMiddleTier_Testing_Ds40"
SQLSERVER_INTEGRATED_SECURITY: "false"
SQLSERVER_USER: "sa"
SQLSERVER_PASS: ${{ secrets.MSSQL_PWD }}
POSTGRES_HOST: "localhost"
POSTGRES_DATABASE_DS32: "edfi_ods_tests_ds32"
POSTGRES_DATABASE_DS33: "edfi_ods_tests_ds33"
POSTGRES_DATABASE_DS40: "edfi_ods_tests_ds40"
POSTGRES_PORT: "5432"
POSTGRES_USER: "postgres"
POSTGRES_PASS: ${{ secrets.POSTGRESQL_PWD }}
POSTGRES_POOLING: "false"
jobs:
AMT-Build-Unit-Tests:
runs-on: Ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Assign release version from .version to Env variable
run: |
cat .version >> $GITHUB_ENV
- name: Caching packages
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a #v3.0.3
with:
dotnet-version: '8.0.x'
- name: Building AMT
run: |
.\build.ps1 build -Configuration ${{ env.CONFIGURATION }} -Version ${{ env.BUILD_VERSION }} -BuildCounter ${{ github.run_number }}
shell: pwsh
- name: Unit Tests
run: |
.\build.ps1 unittest -Configuration ${{ env.CONFIGURATION }}
shell: pwsh
AMT-Integration-Tests:
needs: AMT-Build-Unit-Tests
runs-on: Ubuntu-latest
# Service containers to run with `AMT-runner-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:13
# Provide the password for postgres
env:
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASS }}
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Assign release version from .version to Env variable
run: |
cat .version >> $GITHUB_ENV
- name: Caching packages
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: '8.0.x'
- name: Start Ubuntu container for SQLServer 2019 Express
run: |
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=${{ env.SQLSERVER_ADMIN_PASS }}" -e "MSSQL_PID=Express" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
- name: Create Postgres DB DS v3.2
run: |
.\eng\CreateTestDbAndSchema.ps1 -port ${{ env.POSTGRES_PORT }} -d ${{ env.POSTGRES_DATABASE_DS32 }} -ds 3.2
shell: pwsh
env:
PGPASSWORD: ${{ env.POSTGRES_PASS }}
- name: Create Postgres DB DS v3.3
run: |
.\eng\CreateTestDbAndSchema.ps1 -port ${{ env.POSTGRES_PORT }} -d ${{ env.POSTGRES_DATABASE_DS33 }} -ds 3.3
shell: pwsh
env:
PGPASSWORD: ${{ env.POSTGRES_PASS }}
- name: Create Postgres DB DS v4.0
run: |
.\eng\CreateTestDbAndSchema.ps1 -port ${{ env.POSTGRES_PORT }} -d ${{ env.POSTGRES_DATABASE_DS40 }} -ds 4.0
shell: pwsh
env:
PGPASSWORD: ${{ env.POSTGRES_PASS }}
- name: Building AMT
run: |
.\build.ps1 build -Configuration ${{ env.CONFIGURATION }} -Version ${{ env.BUILD_VERSION }} -BuildCounter ${{ github.run_number }}
shell: pwsh
- name: Integration Tests
run: |
.\build.ps1 integrationtest -Configuration ${{ env.CONFIGURATION }}
shell: pwsh