8.10.3 #3403
Workflow file for this run
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
name: IKVM | |
on: | |
workflow_dispatch: | |
inputs: | |
full_test: | |
required: false | |
type: boolean | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
release: | |
types: | |
- created | |
env: | |
NATIVE_SDK_VERSION: "20240614.1" | |
jobs: | |
build-jtreg: | |
name: Build OpenJDK Test Harness | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache OpenJDK Test Harness Build | |
uses: actions/cache@v4 | |
with: | |
path: ext/jtreg/build | |
key: jtreg-build--${{ runner.os }}--${{ hashFiles('ext/jtreg/**') }}-8 | |
- name: Check OpenJDK Test Harness Build Stamp | |
id: jtreg-build-stamp | |
uses: andstor/file-existence-action@v3 | |
with: | |
files: ext/jtreg/build/stamp | |
- name: Install Java | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install -y \ | |
openjdk-8-jdk-headless && \ | |
echo "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> $GITHUB_ENV | |
- name: Build OpenJDK Test Harness | |
if: steps.jtreg-build-stamp.outputs.files_exists != 'true' | |
run: WGET_OPTS='-U Mozilla/5.0' bash make/build-all.sh $JAVA_HOME && touch build/stamp | |
working-directory: ext/jtreg | |
- name: Package OpenJDK Test Harness | |
run: zip -r /tmp/jtreg-build.zip build | |
working-directory: ext/jtreg | |
- name: Upload OpenJDK Test Harness | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jtreg-build | |
path: /tmp/jtreg-build.zip | |
build-ikvm: | |
name: Build IKVM | |
needs: | |
- build-jtreg | |
timeout-minutes: 720 | |
runs-on: ubuntu-24.04 | |
env: | |
DOTNET_INSTALL_DIR: ${{ github.workspace }}/.dotnet | |
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | |
steps: | |
- name: Uninstall Packages | |
run: | | |
sudo apt-get remove --purge -y \ | |
temurin-\* \ | |
mono-complete \ | |
unixodbc-dev \ | |
nginx \ | |
php\* \ | |
postgresql\* \ | |
python3-dev python3-pip python3-venv \ | |
ruby-full \ | |
firefox \ | |
apache2 \ | |
ant && \ | |
sudo apt-get --purge autoremove -y && \ | |
sudo apt-get clean && \ | |
sudo rm -rf /usr/share/swift | |
- name: Free Disk Space (Linux) | |
if: runner.os == 'Linux' | |
uses: jlumbroso/free-disk-space@main | |
with: | |
swap-storage: false | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Setup .NET 6.0 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 6.0.x | |
- name: Setup .NET 7.0 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 7.0.x | |
- name: Setup .NET 8.0 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Install Mono | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install -y \ | |
mono-runtime \ | |
mono-devel | |
- name: Install Java | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install -y \ | |
openjdk-8-jdk-headless && \ | |
echo "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> $GITHUB_ENV | |
- name: Install LLVM and Clang | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install -y clang-17 llvm-17 && \ | |
echo "PATH=/usr/lib/llvm-17/bin:$PATH" >> $GITHUB_ENV | |
- name: Install apple-codesign | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: apple-codesign | |
version: latest | |
locked: false | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v1 | |
with: | |
versionSpec: 5.x | |
- name: Execute GitVersion | |
uses: gittools/actions/gitversion/execute@v1 | |
with: | |
useConfigFile: true | |
configFilePath: GitVersion.yml | |
- name: Download JTReg Build | |
uses: actions/download-artifact@v4 | |
with: | |
name: jtreg-build | |
path: /tmp | |
- name: Restore JTReg Build | |
run: mkdir -p ext/jtreg && cd ext/jtreg && unzip /tmp/jtreg-build.zip && rm /tmp/jtreg-build.zip | |
- name: Download Native SDKs | |
uses: robinraju/[email protected] | |
with: | |
repository: ikvmnet/ikvm-native-sdk | |
tag: ${{ env.NATIVE_SDK_VERSION }} | |
fileName: "*.tar.gz" | |
out-file-path: ext/ikvm-native-sdk | |
extract: true | |
- name: Add NuGet Source (GitHub) | |
shell: pwsh | |
run: dotnet nuget add source --username USERNAME --password $env:GITHUB_TOKEN --store-password-in-clear-text --name ikvm $env:GITHUB_REPOS | |
env: | |
GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: NuGet Restore | |
run: dotnet restore IKVM.sln | |
- name: Build Artifacts | |
run: | | |
dotnet msbuild /m /bl \ | |
/p:Configuration="Release" \ | |
/p:Platform="Any CPU" \ | |
/p:PreReleaseLabel=${GitVersion_PreReleaseLabel} \ | |
/p:PreReleaseNumber=${GitVersion_WeightedPreReleaseNumber} \ | |
/p:Version=${GitVersion_FullSemVer} \ | |
/p:AssemblyVersion=${GitVersion_AssemblySemVer} \ | |
/p:InformationalVersion=${GitVersion_InformationalVersion} \ | |
/p:FileVersion=${GitVersion_AssemblySemFileVer} \ | |
/p:PackageVersion=${GitVersion_FullSemVer} \ | |
/p:RepositoryUrl="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" \ | |
/p:PackageProjectUrl="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \ | |
/p:BuildInParallel=true \ | |
/p:CreateHardLinksForAdditionalFilesIfPossible=true \ | |
/p:CreateHardLinksForCopyAdditionalFilesIfPossible=true \ | |
/p:CreateHardLinksForCopyFilesToOutputDirectoryIfPossible=true \ | |
/p:CreateHardLinksForCopyLocalIfPossible=true \ | |
/p:CreateHardLinksForPublishFilesIfPossible=true \ | |
/p:ContinuousIntegrationBuild=true \ | |
IKVM.dist.msbuildproj | |
- name: Upload MSBuild Log | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: msbuild.binlog | |
path: msbuild.binlog | |
- name: Package NuGet Packages | |
run: tar czvf /tmp/nuget.tar.gz nuget | |
working-directory: dist | |
- name: Upload NuGet Packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget | |
path: /tmp/nuget.tar.gz | |
- name: Delete NuGet Packages | |
run: rm /tmp/nuget.tar.gz | |
- name: Package Tools | |
run: tar czvf /tmp/tools.tar.gz tools | |
working-directory: dist | |
- name: Upload Tools | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tools | |
path: /tmp/tools.tar.gz | |
- name: Delete Tools | |
run: rm /tmp/tools.tar.gz | |
- name: Package JRE | |
run: tar czvf /tmp/jre.tar.gz jre | |
working-directory: dist | |
- name: Upload JRE | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jre | |
path: /tmp/jre.tar.gz | |
- name: Delete JRE | |
run: rm /tmp/jre.tar.gz | |
- name: Package JDK | |
run: tar czvf /tmp/jdk.tar.gz jdk | |
working-directory: dist | |
- name: Upload JDK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jdk | |
path: /tmp/jdk.tar.gz | |
- name: Delete JDK | |
run: rm /tmp/jdk.tar.gz | |
- name: Package Tests (IKVM.Reflection.Tests) | |
run: tar czvf /tmp/tests--IKVM.Reflection.Tests.tar.gz tests/IKVM.Reflection.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.Reflection.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.Reflection.Tests | |
path: /tmp/tests--IKVM.Reflection.Tests.tar.gz | |
- name: Delete Tests (IKVM.Reflection.Tests) | |
run: rm /tmp/tests--IKVM.Reflection.Tests.tar.gz | |
- name: Package Tests (IKVM.Tests) | |
run: tar czvf /tmp/tests--IKVM.Tests.tar.gz tests/IKVM.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.Tests | |
path: /tmp/tests--IKVM.Tests.tar.gz | |
- name: Delete Tests (IKVM.Tests) | |
run: rm /tmp/tests--IKVM.Tests.tar.gz | |
- name: Package Tests (IKVM.Java.Tests) | |
run: tar czvf /tmp/tests--IKVM.Java.Tests.tar.gz tests/IKVM.Java.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.Java.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.Java.Tests | |
path: /tmp/tests--IKVM.Java.Tests.tar.gz | |
- name: Delete Tests (IKVM.Java.Tests) | |
run: rm /tmp/tests--IKVM.Java.Tests.tar.gz | |
- name: Package Tests (IKVM.Tools.Tests) | |
run: tar czvf /tmp/tests--IKVM.Tools.Tests.tar.gz tests/IKVM.Tools.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.Tools.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.Tools.Tests | |
path: /tmp/tests--IKVM.Tools.Tests.tar.gz | |
- name: Delete Tests (IKVM.Tools.Tests) | |
run: rm /tmp/tests--IKVM.Tools.Tests.tar.gz | |
- name: Package Tests (IKVM.Tools.Exporter.Tests) | |
run: tar czvf /tmp/tests--IKVM.Tools.Exporter.Tests.tar.gz tests/IKVM.Tools.Exporter.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.Tools.Exporter.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.Tools.Exporter.Tests | |
path: /tmp/tests--IKVM.Tools.Exporter.Tests.tar.gz | |
- name: Delete Tests (IKVM.Tools.Exporter.Tests) | |
run: rm /tmp/tests--IKVM.Tools.Exporter.Tests.tar.gz | |
- name: Package Tests (IKVM.Tools.Importer.Tests) | |
run: tar czvf /tmp/tests--IKVM.Tools.Importer.Tests.tar.gz tests/IKVM.Tools.Importer.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.Tools.Importer.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.Tools.Importer.Tests | |
path: /tmp/tests--IKVM.Tools.Importer.Tests.tar.gz | |
- name: Delete Tests (IKVM.Tools.Importer.Tests) | |
run: rm /tmp/tests--IKVM.Tools.Importer.Tests.tar.gz | |
- name: Package Tests (IKVM.MSBuild.Tasks.Tests) | |
run: tar czvf /tmp/tests--IKVM.MSBuild.Tasks.Tests.tar.gz tests/IKVM.MSBuild.Tasks.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.MSBuild.Tasks.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.MSBuild.Tasks.Tests | |
path: /tmp/tests--IKVM.MSBuild.Tasks.Tests.tar.gz | |
- name: Delete Tests (IKVM.MSBuild.Tasks.Tests) | |
run: rm /tmp/tests--IKVM.MSBuild.Tasks.Tests.tar.gz | |
- name: Package Tests (IKVM.MSBuild.Tests) | |
run: tar czvf /tmp/tests--IKVM.MSBuild.Tests.tar.gz tests/IKVM.MSBuild.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.MSBuild.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.MSBuild.Tests | |
path: /tmp/tests--IKVM.MSBuild.Tests.tar.gz | |
- name: Delete Tests (IKVM.MSBuild.Tests) | |
run: rm /tmp/tests--IKVM.MSBuild.Tests.tar.gz | |
- name: Package Tests (IKVM.NET.Sdk.Tests) | |
run: tar czvf /tmp/tests--IKVM.NET.Sdk.Tests.tar.gz tests/IKVM.NET.Sdk.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.NET.Sdk.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.NET.Sdk.Tests | |
path: /tmp/tests--IKVM.NET.Sdk.Tests.tar.gz | |
- name: Delete Tests (IKVM.NET.Sdk.Tests) | |
run: rm /tmp/tests--IKVM.NET.Sdk.Tests.tar.gz | |
- name: Package Tests (IKVM.JTReg.TestAdapter.Tests) | |
run: tar czvf /tmp/tests--IKVM.JTReg.TestAdapter.Tests.tar.gz tests/IKVM.JTReg.TestAdapter.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.JTReg.TestAdapter.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.JTReg.TestAdapter.Tests | |
path: /tmp/tests--IKVM.JTReg.TestAdapter.Tests.tar.gz | |
- name: Delete Tests (IKVM.JTReg.TestAdapter.Tests) | |
run: rm /tmp/tests--IKVM.JTReg.TestAdapter.Tests.tar.gz | |
- name: Package Tests (IKVM.OpenJDK.Tests) | |
run: tar czvf /tmp/tests--IKVM.OpenJDK.Tests.tar.gz tests/IKVM.OpenJDK.Tests | |
working-directory: dist | |
- name: Upload Tests (IKVM.OpenJDK.Tests) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests--IKVM.OpenJDK.Tests | |
path: /tmp/tests--IKVM.OpenJDK.Tests.tar.gz | |
- name: Delete Tests (IKVM.OpenJDK.Tests) | |
run: rm /tmp/tests--IKVM.OpenJDK.Tests.tar.gz | |
- name: Package Documentation | |
run: cd doc && zip /tmp/doc.zip * | |
- name: Upload Documentation | |
uses: actions/upload-artifact@v4 | |
with: | |
name: doc | |
path: /tmp/doc.zip | |
test-vars: | |
name: Test Variables | |
needs: | |
- build-ikvm | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.test-vars.outputs.matrix }} | |
steps: | |
- id: test-vars | |
shell: pwsh | |
env: | |
FULL_TEST: ${{ inputs.full_test }} | |
run: | | |
$sys = @( | |
"win-x64", | |
"linux-x64" | |
) | |
if ($env:FULL_TEST -eq "true") { | |
$sys += @( "osx-x64", "osx-arm64" ) | |
} | |
$tfm = @( | |
"net472", | |
"net8.0" | |
) | |
if ($env:FULL_TEST -eq "true") { | |
$tfm += @( "net6.0" ) | |
} | |
$run = @( | |
"IKVM.Reflection.Tests", | |
"IKVM.Tests", | |
"IKVM.Java.Tests", | |
"IKVM.Tools.Exporter.Tests", | |
"IKVM.Tools.Importer.Tests", | |
"IKVM.Tools.Tests", | |
"IKVM.MSBuild.Tasks.Tests", | |
"IKVM.MSBuild.Tests", | |
"IKVM.NET.Sdk.Tests", | |
"IKVM.JTReg.TestAdapter.Tests") | |
foreach ($_ in (0..15)) { | |
$run += @("IKVM.OpenJDK.Tests?TestPartition=$_") | |
} | |
$exclude = @( | |
@{ | |
"tfm" = "net472" | |
"sys" = "linux-x64" | |
}, | |
@{ | |
"tfm" = "net472" | |
"sys" = "osx-x64" | |
}, | |
@{ | |
"tfm" = "net472" | |
"sys" = "osx-arm64" | |
}, | |
@{ | |
"run" = "IKVM.MSBuild.Tests" | |
"tfm" = "net472" | |
}, | |
@{ | |
"run" = "IKVM.MSBuild.Tests" | |
"tfm" = "net6.0" | |
}, | |
@{ | |
"run" = "IKVM.MSBuild.Tests" | |
"tfm" = "net7.0" | |
}, | |
@{ | |
"run" = "IKVM.MSBuild.Tests" | |
"sys" = "linux-x64" | |
}, | |
@{ | |
"run" = "IKVM.MSBuild.Tests" | |
"sys" = "osx-x64" | |
}, | |
@{ | |
"run" = "IKVM.MSBuild.Tests" | |
"sys" = "osx-arm64" | |
}, | |
@{ | |
"run" = "IKVM.NET.Sdk.Tests" | |
"tfm" = "net472" | |
}, | |
@{ | |
"run" = "IKVM.NET.Sdk.Tests" | |
"tfm" = "net6.0" | |
}, | |
@{ | |
"run" = "IKVM.NET.Sdk.Tests" | |
"tfm" = "net7.0" | |
} | |
) | |
$include = @( | |
@{ | |
"run" = "IKVM.Tests" | |
"tfm" = "net8.0" | |
"sys" = "win-x86" | |
}, | |
@{ | |
"run" = "IKVM.Tests" | |
"tfm" = "net8.0" | |
"sys" = "osx-arm64" | |
} | |
) | |
"matrix=" + (@{ | |
sys = $sys | |
tfm = $tfm | |
run = $run | |
include = $include | |
exclude = $exclude | |
} | ConvertTo-Json -Compress).Replace('"', "'") >> $env:GITHUB_OUTPUT | |
test: | |
needs: | |
- build-ikvm | |
- test-vars | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.test-vars.outputs.matrix) }} | |
name: Test (${{ matrix.run }}:${{ matrix.tfm }}:${{ matrix.sys }}) | |
timeout-minutes: 240 | |
runs-on: ${{ fromJSON('{"win-x86":["windows-2022"],"win-x64":["windows-2022"],"linux-x64":["ubuntu-22.04"],"osx-x64":["macos-13"],"osx-arm64":["macos-14"]}')[matrix.sys] }} | |
steps: | |
- name: Free Disk Space (Linux) | |
if: runner.os == 'Linux' | |
uses: jlumbroso/free-disk-space@main | |
with: | |
dotnet: false | |
swap-storage: false | |
large-packages: false | |
- name: Set Paths (Windows) | |
if: runner.os == 'Windows' | |
shell: pwsh | |
run: | | |
$dir="C:\w" | |
mkdir $dir | |
mkdir $dir\temp | |
mkdir $dir\dotnet | |
mkdir $dir\work | |
Add-Content $env:GITHUB_ENV "`nWORKPATH=$dir\work`n" | |
Add-Content $env:GITHUB_ENV "`nTMP=$dir\temp`nTEMP=$dir\temp`nTMPDIR=$dir\temp`n" | |
Add-Content $env:GITHUB_ENV "`nDOTNET_INSTALL_DIR=$dir\dotnet`n" | |
- name: Set Paths (Linux/OS X) | |
if: runner.os == 'Linux' || runner.os == 'macOS' | |
shell: pwsh | |
run: | | |
$dir="${{ runner.temp }}/w" | |
mkdir $dir | |
mkdir $dir/temp | |
mkdir $dir/dotnet | |
mkdir $dir/work | |
Add-Content $env:GITHUB_ENV "`nWORKPATH=$dir/work`n" | |
Add-Content $env:GITHUB_ENV "`nTMP=$dir/temp`nTEMP=$dir/temp`nTMPDIR=$dir/temp`n" | |
Add-Content $env:GITHUB_ENV "`nDOTNET_INSTALL_DIR=$dir/dotnet`n" | |
- name: Install ProcDump | |
if: runner.os == 'Windows' | |
shell: pwsh | |
run: choco install procdump -y; Add-Content $env:GITHUB_PATH "$env:ProgramData\chocolatey\bin\" | |
- name: Install Visual C++ Runtime | |
if: runner.os == 'Windows' | |
shell: pwsh | |
run: choco install vcredist-all -y | |
- name: Start XVFB (Linux) | |
if: runner.os == 'Linux' | |
run: /usr/bin/Xvfb :99 & disown; echo DISPLAY=:99 >> $GITHUB_ENV | |
- name: Setup .NET 6.0 | |
if: matrix.sys != 'win-x86' | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 6.0.x | |
- name: Setup .NET 7.0 | |
if: matrix.sys != 'win-x86' | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 7.0.x | |
- name: Setup .NET 8.0 | |
if: matrix.sys != 'win-x86' | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Setup .NET 6.0 | |
if: matrix.sys == 'win-x86' | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 6.0.x | |
env: | |
PROCESSOR_ARCHITECTURE: x86 | |
- name: Setup .NET 7.0 | |
if: matrix.sys == 'win-x86' | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 7.0.x | |
env: | |
PROCESSOR_ARCHITECTURE: x86 | |
- name: Setup .NET 8.0 | |
if: matrix.sys == 'win-x86' | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
env: | |
PROCESSOR_ARCHITECTURE: x86 | |
- name: Setup WSL | |
if: runner.os == 'Windows' | |
uses: Vampire/setup-wsl@v3 | |
- name: Setup Linux | |
if: runner.os == 'Linux' | |
shell: bash | |
run: sudo apt-get update && sudo apt-get install -y libasound2 xvfb | |
- name: Get Test Name | |
uses: actions/github-script@v7 | |
id: test-name | |
env: | |
MATRIX_RUN: '${{ matrix.run }}' | |
with: | |
script: | | |
const run = process.env.MATRIX_RUN; | |
const tst = run.split('?')[0]; | |
return tst; | |
result-encoding: string | |
- name: Download Tests | |
uses: actions/download-artifact@v4 | |
with: | |
name: tests--${{ steps.test-name.outputs.result }} | |
path: ${{ env.WORKPATH }} | |
- name: Restore Tests | |
run: tar xzvf tests--${{ steps.test-name.outputs.result }}.tar.gz | |
working-directory: ${{ env.WORKPATH }} | |
- name: Delete Tests | |
shell: pwsh | |
run: ri tests--${{ steps.test-name.outputs.result }}.tar.gz | |
working-directory: ${{ env.WORKPATH }} | |
- name: Execute Tests | |
timeout-minutes: 120 | |
shell: pwsh | |
run: | | |
# assign powershell variables | |
$run = "${{ matrix.run }}" | |
$tfm = "${{ matrix.tfm }}" | |
$sys = "${{ matrix.sys }}" | |
# suite name can contain filter expression after ? | |
$split = $run.IndexOf("?") | |
if ($split -gt -1) { | |
$tst = $run.Substring(0, $split) | |
$qry = $run.Substring($split + 1) | |
} else { | |
$tst = $run | |
} | |
# scan and process test assemblies | |
$tests = gi (".\tests\$tst\$tfm\*.Tests.dll", ".\tests\$tst\$tfm\*.Tests.exe") | |
if ($tests) { | |
$argl = @( | |
"-f", $tfm, | |
"--blame", | |
"--blame-crash", | |
"--blame-hang", | |
"--blame-hang-timeout", "120m", | |
"--blame-hang-dump-type", "full", | |
"-v:diag", | |
"--results-directory", "TestResults", | |
"--logger:console;verbosity=detailed", | |
"--logger:trx" | |
# "--collect", "Code Coverage" | |
) | |
if ($sys -eq "win-x86") { | |
$argl += @("-a", "x86") | |
} | |
$runsettings = $(gi .\tests\$tst\$tfm\*.runsettings) | |
if ($runsettings) { | |
$argl += "--settings:$runsettings" | |
} | |
if ($qry -ne "" -and $qry -ne $null) { | |
$argl += @("--filter", $qry) | |
Add-Content $env:GITHUB_ENV "`nRET=TestResults--$tst-$qry--$tfm--$sys" | |
} else { | |
Add-Content $env:GITHUB_ENV "`nRET=TestResults--$tst--$tfm--$sys" | |
} | |
dotnet test @argl $tests[0].FullName | |
} | |
working-directory: ${{ env.WORKPATH }} | |
- name: Archive Test Results | |
if: always() && startsWith(env.RET, 'TestResults--') | |
run: tar czvf ${{ env.TMPDIR }}/TestResults.tar.gz TestResults | |
working-directory: ${{ env.WORKPATH }} | |
- name: Upload Test Results | |
if: always() && startsWith(env.RET, 'TestResults--') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.RET }} | |
path: ${{ env.TMPDIR }}/TestResults.tar.gz | |
release: | |
name: Release | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Free Disk Space (Linux) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
swap-storage: false | |
large-packages: false | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET 8.0 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v1 | |
with: | |
versionSpec: 5.x | |
- name: Execute GitVersion | |
id: GitVersion | |
uses: gittools/actions/gitversion/execute@v1 | |
with: | |
useConfigFile: true | |
- name: Download NuGet Packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: nuget | |
path: dist | |
- name: Restore NuGet Packages | |
run: tar xzvf nuget.tar.gz | |
working-directory: dist | |
- name: Download Tools | |
uses: actions/download-artifact@v4 | |
with: | |
name: tools | |
path: dist | |
- name: Restore Tools | |
run: tar xzvf tools.tar.gz | |
working-directory: dist | |
- name: Compress Tools | |
shell: pwsh | |
run: cd dist && gi tools/*/* | %{ $tfm = $_.Parent.Name; $rid = $_.Name; Push-Location "tools/$tfm/$rid"; zip -r "../../IKVM-${env:GitVersion_SemVer}-tools-$tfm-$rid.zip" .; tar czvf "../../IKVM-${env:GitVersion_SemVer}-tools-$tfm-$rid.tar.gz" .; Pop-Location } | |
- name: Download JRE | |
uses: actions/download-artifact@v4 | |
with: | |
name: jre | |
path: dist | |
- name: Restore JRE | |
run: tar xzvf jre.tar.gz | |
working-directory: dist | |
- name: Compress JRE | |
shell: pwsh | |
run: cd dist && gi jre/*/* | %{ $tfm = $_.Parent.Name; $rid = $_.Name; Push-Location "jre/$tfm/$rid"; zip -r "../../IKVM-${env:GitVersion_SemVer}-jre-$tfm-$rid.zip" .; tar czvf "../../IKVM-${env:GitVersion_SemVer}-jre-$tfm-$rid.tar.gz" .; Pop-Location } | |
- name: Download JDK | |
uses: actions/download-artifact@v4 | |
with: | |
name: jdk | |
path: dist | |
- name: Restore JDK | |
run: tar xzvf jdk.tar.gz | |
working-directory: dist | |
- name: Compress JDK | |
shell: pwsh | |
run: cd dist && gi jdk/*/* | %{ $tfm = $_.Parent.Name; $rid = $_.Name; Push-Location "jdk/$tfm/$rid"; zip -r "../../IKVM-${env:GitVersion_SemVer}-jdk-$tfm-$rid.zip" .; tar czvf "../../IKVM-${env:GitVersion_SemVer}-jdk-$tfm-$rid.tar.gz" .; Pop-Location } | |
- name: Download Documentation | |
uses: actions/download-artifact@v4 | |
with: | |
name: doc | |
path: dist | |
- name: Create Release | |
if: github.ref_type == 'tag' | |
uses: ncipollo/[email protected] | |
with: | |
tag: ${{ github.ref_name }} | |
allowUpdates: true | |
omitBodyDuringUpdate: true | |
artifacts: dist/nuget/*.nupkg,dist/jre/*.zip,dist/jre/*.tar.gz,dist/jdk/*.zip,dist/jdk/*.tar.gz,dist/tools/*.zip,dist/tools/*.tar.gz,dist/doc.zip | |
draft: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push NuGet (GitHub) | |
if: github.event_name != 'pull_request' | |
shell: pwsh | |
run: dotnet nuget push dist/nuget/*.nupkg --source $env:GITHUB_REPOS --api-key $env:GITHUB_TOKEN --skip-duplicate --no-symbols | |
env: | |
GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push NuGet | |
if: github.ref_type == 'tag' | |
shell: pwsh | |
run: dotnet nuget push dist/nuget/*.nupkg --source $env:NUGET_REPOS --api-key $env:NUGET_TOKEN --skip-duplicate | |
env: | |
NUGET_REPOS: https://api.nuget.org/v3/index.json | |
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} |