[FSSDK-11731] windows version update #591
Workflow file for this run
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
name: Continuous Integration | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
types: [ opened, synchronize, reopened, ready_for_review ] | |
jobs: | |
lintCodebase: | |
name: Lint Codebase if Not Draft | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# Full git history is needed to get a proper list of changed files | |
fetch-depth: 0 | |
- name: Run Super-Linter | |
uses: github/super-linter@v7 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VALIDATE_ALL_CODEBASE: false | |
DEFAULT_BRANCH: master | |
VALIDATE_CSHARP: true | |
netFrameworksAndUnitTest: | |
name: Build Framework & Run Unit Tests | |
needs: [ lintCodebase ] | |
runs-on: windows-2022 # required version for Framework 4.0 | |
env: | |
REPO_SLUG: ${{ github.repository }} | |
BUILD_NUMBER: ${{ github.run_id }} | |
ATTEMPT_NUM: ${{ github.run_attempt }} | |
RUN_NUMBER: ${{ github.run_number }} | |
EVENT_TYPE: ${{ github.event_name }} | |
CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v1 | |
- name: Setup NuGet | |
uses: NuGet/setup-nuget@v1 | |
- name: Install .NET Framework Developer Packs | |
run: | | |
# Install .NET 4.5.1 developer pack (closest available to 4.5) | |
echo "Installing .NET 4.5.1 developer pack (closest to 4.5)..." | |
choco install netfx-4.5.1-devpack -y || echo "4.5.1 installation failed" | |
# Also try 4.5.2 as additional fallback | |
echo "Installing .NET 4.5.2 developer pack as additional option..." | |
choco install netfx-4.5.2-devpack -y || echo "4.5.2 installation failed" | |
# Try .NET 4.0.3 but don't fail the build if it doesn't work | |
echo "Attempting to install .NET 4.0.3 developer pack..." | |
choco install netfx-4.0.3-devpack -y || echo "4.0.3 installation failed, continuing anyway..." | |
# Show what we have available | |
echo "Checking installed targeting packs..." | |
if (Test-Path "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework") { | |
dir "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework" | |
} | |
# Debug: Check what's actually inside v4.5 folder | |
echo "Checking v4.5 folder contents..." | |
if (Test-Path "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5") { | |
dir "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5" | |
} else { | |
echo "v4.5 folder does not exist!" | |
} | |
# Debug: Check MSBuild targeting pack environment | |
echo "MSBuild targeting pack environment..." | |
echo "TargetFrameworkRootPath: $env:TargetFrameworkRootPath" | |
echo "MSBuildExtensionsPath32: $env:MSBuildExtensionsPath32" | |
continue-on-error: true | |
- name: Restore NuGet packages | |
run: nuget restore ./OptimizelySDK.NETFramework.sln | |
- name: Build & strongly name assemblies | |
run: | | |
echo "=== MSBuild Diagnostics ===" | |
echo "Attempting build with verbose logging to diagnose targeting pack resolution..." | |
msbuild /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk /p:Configuration=Release /verbosity:diagnostic /flp:logfile=msbuild.log ./OptimizelySDK.NETFramework.sln | |
echo "=== Build completed, checking for targeting pack errors in log ===" | |
if (Test-Path "msbuild.log") { | |
echo "Searching for targeting pack related messages..." | |
Select-String -Path "msbuild.log" -Pattern "(TargetFramework|Reference.*Assemblies|MSB3644|v4\.5)" | Select-Object -First 20 | |
} | |
- name: Install & Run NUnit tests | |
run: | | |
nuget install NUnit.Console -Version 3.18.1 -DirectDownload -OutputDirectory . | |
# https://docs.nunit.org/articles/nunit/running-tests/Console-Command-Line.html | |
./NUnit.ConsoleRunner.3.18.1\tools\nunit3-console.exe /timeout 10000 /process Separate ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll | |
netStandard16: | |
name: Build Standard 1.6 | |
needs: [ netFrameworksAndUnitTest ] | |
runs-on: windows-2022 | |
env: | |
REPO_SLUG: ${{ github.repository }} | |
BUILD_NUMBER: ${{ github.run_id }} | |
ATTEMPT_NUM: ${{ github.run_attempt }} | |
RUN_NUMBER: ${{ github.run_number }} | |
EVENT_TYPE: ${{ github.event_name }} | |
CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 3.1.x | |
- name: Restore dependencies | |
run: dotnet restore OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj | |
- name: Build & strongly name assemblies | |
run: dotnet build OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk -c Release | |
netStandard20: | |
name: Build Standard 2.0 | |
needs: [ netFrameworksAndUnitTest ] | |
runs-on: windows-2022 | |
env: | |
REPO_SLUG: ${{ github.repository }} | |
BUILD_NUMBER: ${{ github.run_id }} | |
ATTEMPT_NUM: ${{ github.run_attempt }} | |
RUN_NUMBER: ${{ github.run_number }} | |
EVENT_TYPE: ${{ github.event_name }} | |
CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 3.1.x | |
- name: Restore dependencies | |
run: dotnet restore OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj | |
- name: Build & strongly name assemblies | |
run: dotnet build OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(pwd)/keypair.snk -c Release | |
integration_tests: | |
name: Run Integration Tests | |
needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] | |
uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master | |
secrets: | |
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} | |
fullstack_production_suite: | |
name: Run Performance Tests | |
needs: [ netFrameworksAndUnitTest, netStandard16, netStandard20 ] | |
uses: optimizely/csharp-sdk/.github/workflows/integration_test.yml@master | |
with: | |
FULLSTACK_TEST_REPO: ProdTesting | |
secrets: | |
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} |