Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: build JAVA application
on: # multiple triggers when this workflow can run
workflow_dispatch: # also select which job to run
name: build JAVA with artifact application
on:
workflow_dispatch: # multiple triggers when this workflow can run
inputs: # user to select the jobname
job_name: # can be any name like a variable name
description: "Select the Job to run" # desciption visible to user
Expand Down Expand Up @@ -40,9 +40,13 @@ jobs:
- name: build java code
run: mvn clean package
- name: Code Coverage using sonarcloud
run: mvn -B verify sonar:sonar -Dsonar.projectKey=sonar-demo-org-nov-2025_sonar-demo-org-nov-2025-project -Dsonar.organization=sonar-demo-org-nov-2025 -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN
run: mvn -B verify sonar:sonar -Dsonar.projectKey=sonar-qube-org-demo-nov_sonar-demo-org-nov-2025-project -Dsonar.organization=sonar-qube-org-demo-nov -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_TOKEN: Automatically generated token for GitHub API authentication (with limited scope).
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN}}

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_TOKEN: Automatically generated token for GitHub API authentication (with limited scope).
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN}}
- name: upload artifact to github repo
uses: actions/upload-artifact@v4 # Use the latest version
with:
name: myjava-build-artifact
path: /home/runner/work/SonarQubeCoverageJava/SonarQubeCoverageJava/target/wicket-pwnedpasswords-validator-2.0.1-SNAPSHOT.jar