Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Action introduction for Build and Test #68

Merged
merged 13 commits into from
Dec 18, 2020

Conversation

smcvb
Copy link
Member

@smcvb smcvb commented Dec 18, 2020

This pull request introduces a GitHub Action (GHA) to test and build this project, as based on GitHub's Building and Testing with Maven page.
It will perform a run based on JDK 8 and JDK 11.
Only the JDK11 build (should) runs Sonar as well.
Lastly, the results (should be / are) published to AxonIQ's Slack channel, for clarity.
To notify to Slack, the Slack Notify Build action was added.

The tokens used in this script originate from the organization level of this project.
Furthermore, no dedicated Sonar Action was introduced because of the following statement on the Sonar Action's README:

Do not use this GitHub action if you are in the following situations:

  • Your code is built with Maven: run 'org.sonarsource.scanner.maven:sonar' during the build

This solution will replace the current TravisCI approach entirely. As such, this pull request drops the old .travis.yml file.

Introduce an github action to test and build this project. This should
replace the TravisCI solution completely
Wrap parameters in quotes to check whether that resolves the build issue
The sonar token cannot be part of a matrix with using GHA. Hence add
another step with checks whether the matrix.sonar value is true/false
and decide whether to run with/without sonar based on that
The "C" of a channel id should be included, eventhough it's a prefix for
 Slack's channel id's
The if-statments for building with/without sonar were reverted. Switch
that around
If-statements should cope with true/false, so don't equals the strings.
Added, rename field to sonar-enabled, for clarity
Replace true/false values for 1/0, as apparently GHA cant cope with
!true
@sonarcloud
Copy link

sonarcloud bot commented Dec 18, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

warning The version of Java (1.8.0_275) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 11.
Read more here

Run script for pushes to master and pull requests.
Additionally, fix the name of the job to include the java version again
Let's hope this syntax is what GHA is looking for
Use latest version of slack-notify, which is v1.1.2
Shorten name to better visualize it on a GitHub page
Copy link
Contributor

@lfgcampos lfgcampos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job =)

- Put the sonar parameters on new lines to increase readability
- Add badges to the readme to clarify the status of the project
Add missing backslashes to allow mcv to be pasted over several lines
@sonarcloud
Copy link

sonarcloud bot commented Dec 18, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@smcvb smcvb merged commit ca733e6 into master Dec 18, 2020
@smcvb smcvb deleted the feature/test-and-build-gha branch December 18, 2020 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants