Skip to content

Changes by GitHub action (#187) #24

Changes by GitHub action (#187)

Changes by GitHub action (#187) #24

# This is a basic workflow to help you get started with Actions
name: CI_REFLECT_TEST_COMMIT
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
# only trigger on branches, not on tags
branches: '**'
# This workflow contains two jobs called "check" and "build_windows"
jobs:
# Verify if a build is needed
check:
if: ${{ github.repository_owner == 'masesgroup' || (github.repository_owner != 'masesgroup' && github.ref_name != 'master') }} #do not execute on master outside main repo
name: Check changed files
outputs:
run_job: ${{ steps.check_files.outputs.run_job }}
runs-on: ubuntu-latest
steps:
- id: get_changed_files
uses: masesgroup/retrieve-changed-files@v3
with:
format: 'csv'
- id: check_files
run: |
mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.get_changed_files.outputs.added_modified }}')
for added_modified_file in "${added_modified_files[@]}"; do
if [[ $added_modified_file == ".github/workflows/reflect_test_commit.yaml"* ]]; then
echo "$added_modified_file is under the directory '.github/workflows'."
echo "run_job=true" >> $GITHUB_OUTPUT
break
fi
if [[ $added_modified_file == "src/jvm/src/JCOReflector/"* ]]; then
echo "$added_modified_file is under the directory 'src/jvm/src/JCOReflector'."
echo "run_job=true" >> $GITHUB_OUTPUT
break
fi
if [[ $added_modified_file == "src/net/"* ]]; then
echo "$added_modified_file is under the directory 'src/'."
echo "run_job=true" >> $GITHUB_OUTPUT
break
fi
if [[ $added_modified_file == "tests/jvm/"* ]]; then
echo "$added_modified_file is under the directory 'tests/jvm/'."
echo "run_job=true" >> $GITHUB_OUTPUT
break
fi
done
# This workflow contains a single job called "build"
build_windows:
needs: check
if: needs.check.outputs.run_job == 'true'
# The type of runner that the job will run on
runs-on: windows-2022
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
# Runs a set of commands using the runners shell
- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" src\net\JCOReflectorCLI.sln
- uses: nuget/[email protected]
with:
nuget-version: '5.x'
- run: nuget pack src\net\CLI\JCOReflectorCLI.nuspec -OutputDirectory .\bin
# Runs a set of commands using the runners shell
- name: Copy configuration file
run: |
Copy-Item .github\workflows\JCOReflectorCLI_net6.0.runtimeconfig.json -Destination bin\net6.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force
Copy-Item .github\workflows\JCOReflectorCLI_net8.0.runtimeconfig.json -Destination bin\net8.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force
- name: Remove Java files
run: |
Remove-Item .\src\jvm\src\net6.0 -Recurse -Force
Remove-Item .\src\jvm\src\net8.0 -Recurse -Force
Remove-Item .\src\jvm\src\net462 -Recurse -Force
- name: Reflect .NET 6.0 Java files
run: .\bin\net6.0\MASES.JCOReflectorCLI -JobType Reflect -JobFile .github\workflows\reflect_net6.0.job
- name: Reflect .NET 8.0 Java files
run: .\bin\net8.0\MASES.JCOReflectorCLI -JobType Reflect -JobFile .github\workflows\reflect_net8.0.job
- name: Reflect .NET Framework Java files
run: .\bin\net462\MASES.JCOReflectorCLI -JobType Reflect -JobFile .github\workflows\reflect_net462.job
- name: Build Java files .NET Core 6.0
run: .\bin\net6.0\MASES.JCOReflectorCLI -JobType Build -JobFile .github\workflows\build_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build Java files .NET Core 8.0
run: .\bin\net8.0\MASES.JCOReflectorCLI -JobType Build -JobFile .github\workflows\build_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build Java files .NET Framework
run: .\bin\net462\MASES.JCOReflectorCLI -JobType Build -JobFile .github\workflows\build_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build JAR files .NET Core 6.0
run: .\bin\net6.0\MASES.JCOReflectorCLI -JobType CreateJars -JobFile .github\workflows\createjars_net6.0_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build JAR files .NET Core 8.0
run: .\bin\net8.0\MASES.JCOReflectorCLI -JobType CreateJars -JobFile .github\workflows\createjars_net8.0_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build JAR files .NET Framework
run: .\bin\net462\MASES.JCOReflectorCLI -JobType CreateJars -JobFile .github\workflows\createjars_net462_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Download Scala package
run: C:\msys64\usr\bin\wget.exe https://downloads.lightbend.com/scala/2.13.13/scala-2.13.13.zip
- name: Expand Scala package
run: Expand-Archive -LiteralPath '.\scala-2.13.13.zip' -DestinationPath .\bin\ -Force
- name: Save JCOReflector source in cache
uses: actions/cache/save@v4
with:
enableCrossOsArchive: true
path: ./src/jvm/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_source_${{ github.sha }}
- name: Save JCOReflector bin in cache
uses: actions/cache/save@v4
with:
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_windows_bin_${{ github.sha }}
# This workflow contains a single job called "build"
build_linux:
needs: build_windows
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector source from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./src/jvm/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_source_${{ github.sha }}
# Runs a set of commands using the runners shell
- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --framework net6.0 --configuration Release src/net/JCOReflectorCLI.sln
- name: Build Java files
run: dotnet bin/net6.0/MASES.JCOReflectorCLI.dll -JobType Build -JDKFolder $JAVA_HOME_11_X64 -JobFile .github/workflows/build_linux.job
- name: Build JAR files
run: dotnet bin/net6.0/MASES.JCOReflectorCLI.dll -JobType CreateJars -JDKFolder $JAVA_HOME_11_X64 -JobFile .github/workflows/createjars_net6.0_linux.job
- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --framework net8.0 --configuration Release src/net/JCOReflectorCLI.sln
- name: Build Java files
run: dotnet bin/net8.0/MASES.JCOReflectorCLI.dll -JobType Build -JDKFolder $JAVA_HOME_11_X64 -JobFile .github/workflows/build_linux.job
- name: Build JAR files
run: dotnet bin/net8.0/MASES.JCOReflectorCLI.dll -JobType CreateJars -JDKFolder $JAVA_HOME_11_X64 -JobFile .github/workflows/createjars_net8.0_linux.job
- name: Extract commit SHA
run: |
echo "GITHUB_COMMIT_MESSAGE=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
- name: Save JCOReflector bin in cache
uses: actions/cache/save@v4
with:
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_linux_bin_${{ github.sha }}
execute_java_tests_windows:
needs: build_windows
strategy:
fail-fast: false
matrix:
framework: [ 'net462', 'net6.0', 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- jdk_vendor: oracle
jdk_version: 11
runs-on: windows-latest
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_windows_bin_${{ github.sha }}
- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'
- name: Build Java test source file for ${{ matrix.framework }}
run: javac -cp ./bin/${{ matrix.framework }}/JCOReflector.jar ./tests/jvm/java/src/hierarchy/*.java ./tests/jvm/java/src/mscorlib/*.java ./tests/jvm/java/src/nettest/*.java ./tests/jvm/java/src/refout/*.java
- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" mscorlib.HelloNET ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" nettest.HelloNETSocket ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" nettest.HelloNETSocket -async ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" refout.HelloRefOutBase ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar;./tests/jvm/java/src/" refout.HelloRefOut ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- uses: actions/upload-artifact@v4
with:
name: Errors_java_tests_windows_${{ matrix.framework }}_${{ matrix.jdk_vendor }}_${{ matrix.jdk_version }}
path: .\hs_err_*
retention-days: 1
execute_scala_tests_windows:
needs: build_windows
strategy:
fail-fast: false
matrix:
framework: [ 'net462', 'net6.0', 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- jdk_vendor: oracle
jdk_version: 11
runs-on: windows-latest
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_windows_bin_${{ github.sha }}
- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'
- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV
- name: Build Scala test source file for ${{ matrix.framework }}
shell: cmd
run: |
cd ./tests/jvm/scala
mkdir output
..\..\..\bin\scala-2.13.13\bin\scalac -toolcp "../../../bin/${{ matrix.framework }}/*" -d ./output ./src/main/scala/hierarchy/* ./src/main/scala/mscorlib/* ./src/main/scala/nettest/* ./src/main/scala/refout/*
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" mscorlib.HelloNet ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" nettest.HelloNETSocket ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" nettest.HelloNETSocket -async ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" refout.HelloRefOutBase ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: .\bin\scala-2.13.13\bin\scala -toolcp "./bin/${{ matrix.framework }}/*;./tests/jvm/scala/output" refout.HelloRefOut ${{ env.EXTRA_ARGUMENT }}
shell: cmd
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: cd ./tests/jvm/scala && rmdir output /s /q
shell: cmd
continue-on-error: true
- uses: actions/upload-artifact@v4
with:
name: Errors_scala_tests_windows_${{ matrix.framework }}_${{ matrix.jdk_vendor }}_${{ matrix.jdk_version }}
path: .\hs_err_*
retention-days: 1
execute_java_tests_unix:
needs: build_linux
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macos-latest', 'macos-13' ]
framework: [ 'net6.0', 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- os: macos-latest
framework: net6.0
- os: macos-13
framework: net6.0
- jdk_vendor: oracle
jdk_version: 11
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_linux_bin_${{ github.sha }}
- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'
- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV
- name: Build Java test source file
run: javac -cp ./bin/${{ matrix.framework }}/JCOReflector.jar ./tests/jvm/java/src/hierarchy/*.java ./tests/jvm/java/src/mscorlib/*.java ./tests/jvm/java/src/nettest/*.java ./tests/jvm/java/src/refout/*.java
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" mscorlib.HelloNET ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" nettest.HelloNETSocket -server 127.0.0.1 ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: java -cp "./bin/${{ matrix.framework }}/JCOReflector.jar:./tests/jvm/java/src/" nettest.HelloNETSocket -async -server 127.0.0.1 ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
#java -cp "./bin/net6.0/JCOReflector.jar;./tests/jvm/java/src/" refout.HelloRefOutBase
#java -cp "./bin/net6.0/JCOReflector.jar;./tests/jvm/java/src/" refout.HelloRefOut
- uses: actions/upload-artifact@v4
with:
name: Errors_java_tests_${{ matrix.os }}_${{ matrix.framework }}_${{ matrix.jdk_vendor }}_${{ matrix.jdk_version }}
path: .\hs_err_*
retention-days: 1
execute_scala_tests_linux:
needs: build_linux
strategy:
fail-fast: false
matrix:
framework: [ 'net6.0', 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- jdk_vendor: oracle
jdk_version: 11
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_linux_bin_${{ github.sha }}
- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'
- name: Download and install Scala package
run: |
sudo apt update
sudo apt-get install unzip
sudo apt-get install zip
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install scala 2.13.13
- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV
- name: Build Scala test source file
run: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
mkdir ./tests/jvm/scala/output
scalac -cp "./bin/${{ matrix.framework }}/*" -d ./tests/jvm/scala/output ./tests/jvm/scala/src/main/scala/hierarchy/* ./tests/jvm/scala/src/main/scala/mscorlib/* ./tests/jvm/scala/src/main/scala/nettest/* ./tests/jvm/scala/src/main/scala/refout/*
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloNet ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" nettest.HelloNETSocket ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" nettest.HelloNETSocket -async ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" refout.HelloRefOutBase ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: source "$HOME/.sdkman/bin/sdkman-init.sh" && scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" refout.HelloRefOut ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: rm -rf ./tests/jvm/scala/output
- uses: actions/upload-artifact@v4
with:
name: Errors_java_tests_linux_${{ matrix.framework }}_${{ matrix.jdk_vendor }}_${{ matrix.jdk_version }}
path: .\hs_err_*
retention-days: 1
execute_scala_tests_mac:
needs: build_linux
strategy:
fail-fast: false
matrix:
os: [ 'macos-latest', 'macos-13' ]
framework: [ 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- os: macos-latest
framework: net6.0
- os: macos-13
framework: net6.0
- jdk_vendor: oracle
jdk_version: 11
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_linux_bin_${{ github.sha }}
- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'
- name: Download and install Scala package
run: brew install [email protected]
- name: Export Scala root
if: matrix.os == 'macos-13'
run: |
echo "SCALA_BIN=/usr/local/opt/[email protected]/bin" >> $GITHUB_ENV
shell: bash
- name: Export Scala root
if: matrix.os == 'macos-latest'
run: |
echo "SCALA_BIN=/opt/homebrew/opt/[email protected]/bin" >> $GITHUB_ENV
shell: bash
- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV
- name: Build Scala test source file
run: |
mkdir ./tests/jvm/scala/output
${{ env.SCALA_BIN }}/scalac -cp "./bin/${{ matrix.framework }}/*" -d ./tests/jvm/scala/output ./tests/jvm/scala/src/main/scala/hierarchy/* ./tests/jvm/scala/src/main/scala/mscorlib/* ./tests/jvm/scala/src/main/scala/nettest/* ./tests/jvm/scala/src/main/scala/refout/*
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloNet ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" nettest.HelloNETSocket ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" nettest.HelloNETSocket -async ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" refout.HelloRefOutBase ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" refout.HelloRefOut ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: rm -rf ./tests/jvm/scala/output
- uses: actions/upload-artifact@v4
with:
name: Errors_scala_tests_${{ matrix.os }}_${{ matrix.framework }}_${{ matrix.jdk_vendor }}_${{ matrix.jdk_version }}
path: .\hs_err_*
retention-days: 1
execute_finalize:
needs: [execute_java_tests_windows, execute_scala_tests_windows, execute_java_tests_unix, execute_scala_tests_linux, execute_scala_tests_mac]
runs-on: windows-latest
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_windows_bin_${{ github.sha }}
- name: Restore JCOReflector source from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./src/jvm/
key: JCOReflector_${{ github.run_number }}_${{ github.run_attempt }}_source_${{ github.sha }}
- name: Compress release files
run: |
Compress-Archive -Path .\bin\net6.0\* -DestinationPath .\bin\net6.0.zip
Compress-Archive -Path .\bin\net8.0\* -DestinationPath .\bin\net8.0.zip
Compress-Archive -Path .\bin\net462\* -DestinationPath .\bin\net462.zip
- name: Extract commit SHA
run: |
echo "GITHUB_COMMIT_MESSAGE=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
shell: bash
- name: Request a PR to commit changes
if: ${{ github.repository_owner == 'masesgroup' }} # do not push any changes outside main repo or GeneratePR is false
uses: peter-evans/create-pull-request@v6
with:
branch-suffix: short-commit-hash
add-paths: |
.\src\jvm\statistics\*.*
.\src\jvm\README.md
.\src\jvm\src\*.list
.\src\jvm\src\*.java
commit-message: Update JVM after commit ${{ env.GITHUB_COMMIT_MESSAGE }}
title: Changes by GitHub action
body: Automated changes by GitHub action
reviewers: masesdevelopers
assignees: masesdevelopers
labels: enhancement, java, .NET Framework, .NET 6, .NET 8
# - name: Commit statistics changes
# if: ${{ github.repository_owner == 'masesgroup'}} #do not push any changes outside main repo
# uses: EndBug/add-and-commit@v9
# with:
# author_name: github-actions
# author_email: 41898282+github-actions[bot]@users.noreply.github.com
# add: '.\src\jvm\statistics\*.*'
# message: Update statistics after commit ${{ env.GITHUB_COMMIT_MESSAGE }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Commit report changes
# if: ${{ github.repository_owner == 'masesgroup'}} #do not push any changes outside main repo
# uses: EndBug/add-and-commit@v9
# with:
# author_name: github-actions
# author_email: 41898282+github-actions[bot]@users.noreply.github.com
# add: '.\src\jvm\README.md'
# message: Update README.md after commit ${{ env.GITHUB_COMMIT_MESSAGE }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Commit source changes
# if: ${{ github.repository_owner == 'masesgroup'}} #do not push any changes outside main repo
# uses: EndBug/add-and-commit@v9
# with:
# author_name: github-actions
# author_email: 41898282+github-actions[bot]@users.noreply.github.com
# add: '.\src\jvm\src\*.list'
# message: Update assembly list after commit ${{ env.GITHUB_COMMIT_MESSAGE }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Commit source changes
# if: ${{ github.repository_owner == 'masesgroup'}} #do not push any changes outside main repo
# uses: EndBug/add-and-commit@v9
# with:
# author_name: github-actions
# author_email: 41898282+github-actions[bot]@users.noreply.github.com
# add: '.\src\jvm\src\*.java'
# message: Update sources after commit ${{ env.GITHUB_COMMIT_MESSAGE }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: NuGet
path: .\bin\*nupkg
- uses: actions/upload-artifact@v4
with:
name: net6.0
path: .\bin\net6.0.zip
- uses: actions/upload-artifact@v4
with:
name: net8.0
path: .\bin\net8.0.zip
- uses: actions/upload-artifact@v4
with:
name: net462
path: .\bin\net462.zip
final_cleanup:
needs: [ execute_finalize ]
if: "always()"
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Clear caches
run: |
gh extension install actions/gh-actions-cache
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list --key JCOReflector_${{ github.run_number }}_${{ github.run_attempt }} | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}