Skip to content

Commit

Permalink
Merge pull request #154 from ikvm-revived/feature/javatest
Browse files Browse the repository at this point in the history
IKVM.OpenJDK.Tests
  • Loading branch information
wasabii authored Oct 29, 2022
2 parents fca264c + a5e90b5 commit 5f225f7
Show file tree
Hide file tree
Showing 65 changed files with 7,746 additions and 198 deletions.
192 changes: 97 additions & 95 deletions .github/workflows/IKVM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,15 @@ jobs:
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Setup WSL
uses: Vampire/setup-wsl@v1
with:
additional-packages:
gcc
g++
- name: Setup .NET
run: ac $env:GITHUB_ENV "`nDOTNET_INSTALL_DIR=${{ runner.temp }}\dotnet"
shell: pwsh
run: Add-Content $env:GITHUB_ENV "`nDOTNET_INSTALL_DIR=${{ runner.temp }}\dotnet"
- name: Setup .NET 3.1
uses: actions/setup-dotnet@v3
with:
Expand All @@ -138,23 +145,17 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup WSL
uses: Vampire/setup-wsl@v1
with:
additional-packages:
gcc
g++
- name: Move Temporary Directory
shell: pwsh
run: Add-Content $env:GITHUB_ENV "`nTMP=${{ runner.temp }}`nTMP=${{ runner.temp }}"
run: Add-Content $env:GITHUB_ENV "`nTMP=${{ runner.temp }}`nTEMP=${{ runner.temp }}`nTMPDIR=${{ runner.temp }}"
- name: Move NuGet Directory
shell: pwsh
run: Add-Content $env:GITHUB_ENV "`nNUGET_PACKAGES=${{ runner.temp }}\nuget\packages"
- name: Cache NuGet
uses: actions/cache@v3
with:
path: ${{ runner.temp }}\nuget\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**\*.sln', '**\*.csproj', '**\*.msbuildproj', '!dist') }}
key: ${{ runner.os }}-nuget-${{ hashFiles('IKVM.sln', 'src\**\*.csproj', 'src\**\*.msbuildproj') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Add msbuild to PATH
uses: microsoft/[email protected]
Expand All @@ -164,8 +165,18 @@ jobs:
name: openjdk-build-linux-x86_64-normal-server-release
path: openjdk/build
- name: Restore OpenJDK 8 Build
run: unzip -o openjdk-build-linux-x86_64-normal-server-release.zip
shell: pwsh
run: Expand-Archive openjdk-build-linux-x86_64-normal-server-release.zip .
working-directory: openjdk/build
- name: Download JTReg Build
uses: actions/download-artifact@v3
with:
name: jtreg-build
path: jtreg
- name: Restore JTReg Build
shell: pwsh
run: Expand-Archive jtreg-build.zip .
working-directory: jtreg
- name: NuGet Restore
run: dotnet restore IKVM.sln
- name: Build Artifacts
Expand Down Expand Up @@ -194,59 +205,46 @@ jobs:
with:
name: msbuild.binlog
path: msbuild.binlog
- name: Package NuGet Packages
run: tar czvf C:\nuget.tar.gz nuget
working-directory: dist
- name: Upload NuGet Packages
uses: actions/upload-artifact@v3
with:
name: nuget
path: dist/nuget/*.nupkg
path: C:\nuget.tar.gz
- name: Package Binaries
run: tar czvf bin.tar.gz bin
run: tar czvf C:\bin.tar.gz bin
working-directory: dist
- name: Upload Binaries
uses: actions/upload-artifact@v3
with:
name: bin
path: dist/bin.tar.gz
- name: Delete Binaries
shell: pwsh
run: ri bin.tar.gz
working-directory: dist
path: C:\bin.tar.gz
- name: Package Tools
run: tar czvf tools.tar.gz tools
run: tar czvf C:\tools.tar.gz tools
working-directory: dist
- name: Upload Tools
uses: actions/upload-artifact@v3
with:
name: tools
path: dist/tools.tar.gz
- name: Delete Tools
shell: pwsh
run: ri tools.tar.gz
working-directory: dist
path: C:\tools.tar.gz
- name: Package Image
run: tar czvf image.tar.gz image
run: tar czvf C:\image.tar.gz image
working-directory: dist
- name: Upload Image
uses: actions/upload-artifact@v3
with:
name: image
path: dist/image.tar.gz
- name: Delete Image
shell: pwsh
run: ri image.tar.gz
working-directory: dist
path: C:\image.tar.gz
- name: Package Tests
run: tar czvf tests.tar.gz tests
run: tar czvf C:\tests.tar.gz tests
working-directory: dist
- name: Upload Tests
uses: actions/upload-artifact@v3
with:
name: tests
path: dist/tests.tar.gz
- name: Delete Tests
shell: pwsh
run: ri tests.tar.gz
working-directory: dist
path: C:\tests.tar.gz
- name: Clean Solution
run: |
git reset --hard
Expand All @@ -261,74 +259,72 @@ jobs:
- ikvmc.Tests
- IKVM.Tools.Exporter.Tests
- IKVM.Tools.Tests
- IKVM.MSBuild.Tasks.Tests
- IKVM.MSBuild.Tests
- IKVM.NET.Sdk.Tests
- IKVM.JTReg.TestAdapter.Tests
- IKVM.OpenJDK.Tests?TestPartition=0
- IKVM.OpenJDK.Tests?TestPartition=1
- IKVM.OpenJDK.Tests?TestPartition=2
- IKVM.OpenJDK.Tests?TestPartition=3
- IKVM.OpenJDK.Tests?TestPartition=4
- IKVM.OpenJDK.Tests?TestPartition=5
- IKVM.OpenJDK.Tests?TestPartition=6
- IKVM.OpenJDK.Tests?TestPartition=7
tfm:
- net461
- net472
- net48
- netcoreapp3.1
- net6.0
sys:
- windows
- ubuntu
- linux
exclude:
- sys: ubuntu
tfm: net461
- sys: ubuntu
tfm: net472
- sys: ubuntu
tfm: net48
- run: IKVM.MSBuild.Tasks.Tests
sys: ubuntu
- run: IKVM.MSBuild.Tests
sys: ubuntu
- run: IKVM.NET.Sdk.Tests
sys: ubuntu
- run: IKVM.Tests
tfm: net472
- run: IKVM.Tests.JRE
tfm: net472
- run: IKVM.Tests.JDK
tfm: net472
- run: IKVM.Tools.Exporter.Tests
tfm: net472
- run: IKVM.Tools.Exporter.Tests
tfm: net48
- tfm: net461
sys: linux
- run: IKVM.Tools.Exporter.Tests
tfm: net6.0
- run: IKVM.Tools.Tests
tfm: net472
- run: ikvmc.Tests
tfm: net472
- run: ikvmc.Tests
tfm: net48
- run: ikvmc.Tests
tfm: net6.0
- run: IKVM.MSBuild.Tests
tfm: net461
- run: IKVM.MSBuild.Tests
- run: IKVM.OpenJDK.Tests?TestPartition=0
sys: linux
- run: IKVM.OpenJDK.Tests?TestPartition=1
sys: linux
- run: IKVM.OpenJDK.Tests?TestPartition=2
sys: linux
- run: IKVM.OpenJDK.Tests?TestPartition=3
sys: linux
- run: IKVM.OpenJDK.Tests?TestPartition=4
sys: linux
- run: IKVM.OpenJDK.Tests?TestPartition=5
sys: linux
- run: IKVM.OpenJDK.Tests?TestPartition=6
sys: linux
- run: IKVM.OpenJDK.Tests?TestPartition=7
sys: linux
include:
- run: IKVM.MSBuild.Tasks.Tests
tfm: net472
- run: IKVM.MSBuild.Tests
tfm: net48
- run: IKVM.MSBuild.Tests
sys: windows
- run: IKVM.MSBuild.Tasks.Tests
tfm: netcoreapp3.1
sys: windows
- run: IKVM.MSBuild.Tasks.Tests
tfm: net6.0
sys: windows
- run: IKVM.MSBuild.Tests
tfm: net6.0
sys: windows
- run: IKVM.NET.Sdk.Tests
sys: ubuntu
- run: IKVM.NET.Sdk.Tests
tfm: net461
- run: IKVM.NET.Sdk.Tests
tfm: net472
- run: IKVM.NET.Sdk.Tests
tfm: net48
- run: IKVM.NET.Sdk.Tests
tfm: netcoreapp3.1
tfm: net6.0
sys: windows
name: Test IKVM (${{ matrix.run }}:${{ matrix.tfm }}:${{ matrix.sys }}
needs:
- build-ikvm
runs-on: ${{ matrix.sys }}-latest
runs-on: ${{ fromJSON('{"windows":["windows-2022"],"linux":["ubuntu-22.04"]}')[matrix.sys] }}
steps:
- name: Setup WSL
if: matrix.sys == 'windows'
uses: Vampire/setup-wsl@v1
- name: Setup .NET
shell: pwsh
run: Add-Content $env:GITHUB_ENV "`nDOTNET_INSTALL_DIR=${{ runner.temp }}/dotnet"
- name: Setup .NET 3.1
uses: actions/setup-dotnet@v3
with:
Expand All @@ -339,7 +335,7 @@ jobs:
dotnet-version: 6.0.x
- name: Move Temporary Directory
shell: pwsh
run: Add-Content $env:GITHUB_ENV "`nTMP=${{ runner.temp }}`nTMP=${{ runner.temp }}"
run: Add-Content $env:GITHUB_ENV "`nTMP=${{ runner.temp }}`nTEMP=${{ runner.temp }}`nTMPDIR=${{ runner.temp }}"
- name: Download Tests
uses: actions/download-artifact@v3
with:
Expand All @@ -353,6 +349,7 @@ jobs:
run: ri tests.tar.gz
working-directory: dist
- name: Execute Tests
timeout-minutes: 120
shell: pwsh
run: |
# assign powershell variables
Expand All @@ -363,28 +360,30 @@ jobs:
# suite name can contain filter expression after ?
$split = $run.IndexOf("?")
if ($split -gt -1) {
$suite = $run.Substring(0, $split)
$query = $run.Substring($split + 1)
$tst = $run.Substring(0, $split)
$qry = $run.Substring($split + 1)
} else {
$suite = $run
$tst = $run
}
# scan for test assemblies
$tests = $(gci .\dist\tests\$suite\$tfm -Recurse -Filter '*.Tests.dll')
$tests = $(gci .\dist\tests\$tst\$tfm -Recurse -Filter '*.Tests.dll')
# if a query was specified, add to test command
if ($tests) {
if ($query -ne "" -and $query -ne $null) {
dotnet test -f $tfm --blame -v 2 --results-directory "TestResults" --logger:"console;verbosity=detailed" --logger:trx --collect "Code Coverage" --filter "$query" $tests
if ($qry -ne "" -and $qry -ne $null) {
Add-Content $env:GITHUB_ENV "`nRET=TestResults--$tst-$qry--$tfm--$sys"
dotnet test -f $tfm --blame -v 2 --results-directory "TestResults" --logger:"console;verbosity=detailed" --logger:trx --collect "Code Coverage" --filter "$qry" $tests
} else {
Add-Content $env:GITHUB_ENV "`nRET=TestResults--$tst--$tfm--$sys"
dotnet test -f $tfm --blame -v 2 --results-directory "TestResults" --logger:"console;verbosity=detailed" --logger:trx --collect "Code Coverage" $tests
}
}
- name: Upload Test Results
if: ${{ always() }}
if: always() && startsWith(env.RET, 'TestResults--')
uses: actions/upload-artifact@v3
with:
name: TestResults--${{ matrix.run }}--${{ matrix.tfm }}--${{ matrix.sys }}
name: ${{ env.RET }}
path: TestResults
release:
name: Release
Expand All @@ -410,7 +409,10 @@ jobs:
uses: actions/download-artifact@v3
with:
name: nuget
path: dist/nuget
path: dist
- name: Restore NuGet Packages
run: tar xzvf nuget.tar.gz
working-directory: dist
- name: Download Binaries
uses: actions/download-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[submodule "openjdk"]
path = openjdk
url = https://github.com/openjdk/jdk8u.git
url = https://github.com/ikvm-revived/jdk8u.git
ignore = dirty
[submodule "jtreg"]
path = jtreg
url = https://github.com/openjdk/jtreg.git
url = https://github.com/ikvm-revived/jtreg.git
ignore = dirty
Loading

0 comments on commit 5f225f7

Please sign in to comment.