masesgroup / JCOReflector

A set of Java classes to use .NET from any JVM enabled language (Java, Kotlin, Scala and others)

Home Page:https://jcoreflector.masesgroup.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add CI/CD workflows

mariomastrodicasa opened this issue · comments

Is your feature request related to a problem? Please describe.
It is necessary to introduce workflows to manage the build chain to obtain the final JARs.

Describe the solution you'd like
Split the continuous integration in three macro-step:

  • On a Windows machine (windows-latest seems the correct one) execute:
    1. Remove the actual reflected Java sources tree under netreflected/src/netcoreapp3.1 and netreflected/src/net461 (.NET 5 will be done when it will be released)
    2. Complete reflection of both .NET Core and Framework (.NET 5 will be done when it will be released) using the latest CLI tool
    3. Execute a complete build of generated Java classes of both .NET Core and Framework (.NET 5 will be done when it will be released)
    4. Create the JARs of both .NET Core and Framework (.NET 5 will be done when it will be released)
    5. Build and run the test classes to check consistency on runtime
    6. Commit the generated Java source with a commit related to the trigger which has started the workflow
  • On a Linux machine (only if the previous step has finished correctly)
    1. Execute a complete build of generated Java class of both .NET Core and Framework (.NET 5 will be done when it will be released)
    2. Create the JARs of both .NET Core and Framework (.NET 5 will be done when it will be released)
    3. Build and run the test classes to check consistency on runtime
  • On a machine (only if the previous step has finished correctly and when there is a new tag)
    1. Execute a complete build of generated Java class of both .NET Core and Framework (.NET 5 will be done when it will be released)
    2. Create the JARs of both .NET Core and Framework (.NET 5 will be done when it will be released) and upload them associated to the tag
    3. Create the docs and update the docs repository

Describe alternatives you've considered
No other, we rely on github CI machines.

Additional context
N/A

@marcocappolimases CI_LINUX does not execute all test, seems only the first one was executed: I compared logs of CI_WINDOWS and CI_LINUX related to test execution job.

@marcocappolimases is it possible to add an action like CI_WINDOWS, that executes only steps 1, 2 and 3, on all other branches excluded the master?

@marcocappolimases seems the jobs start even if there are no changes on folders or files impacting the activity of the job itself. I found this article where it is written how to filter jobs based on impacted files in the commits.

@marcocappolimases there is a issue in the CI_LINUX workflow. If CI_WINDOWS creates a new commit related to changed files under netreflected folder, the check made from CI_LINUX on the latest commit reports no changes within the folders under control, so it does not execute.

I reopen the issue to have a workflow only for pull-requests (PR). Actual workflow fails on PRs because when requests the final commit git answer with There is no tracking information for the current branch.
Meanwhile the TESTBRANCH workflow shall be updated to add execution of tests.

Linux workflow fails to run tests for refout folder with error java.lang.ClassNotFoundException: refout.HelloRefOutBase. Compilation seems to work.
Reopen issue to check why the test code fails only on Linux machine while it runs on Windows machine.

SDKMAN now downloads Scala version 3.* and on this version was removed the option -nobootcp. Update linux.yaml script to avoid errors with the latest version of scala. Anyway seems that SDKMAN can download Kotlin packages: it is possible to add Kotlin tests to CI/CD.