Set up your GitHub Actions workflow with a specific version of Apache Maven
Go to file
2022-07-28 17:16:25 +07:00
dist Analyze source code with SonarQube 2022-07-28 00:14:07 +07:00
src Analyze source code with SonarQube 2022-07-28 00:14:07 +07:00
.editorconfig - Remove unused dependencies 2022-07-26 23:45:42 +07:00
.gitattributes - Remove unused dependencies 2022-07-26 23:45:42 +07:00
.gitignore - Remove unused dependencies 2022-07-26 23:45:42 +07:00
action.yml Bump version to release v5.0 2022-07-27 13:26:17 +07:00
package-lock.json Integrate jest testing framework 2022-07-28 17:16:25 +07:00
package.json Integrate jest testing framework 2022-07-28 17:16:25 +07:00
README.md Integrate jest testing framework 2022-07-28 17:16:25 +07:00
tsconfig.json Integrate jest testing framework 2022-07-28 17:16:25 +07:00

How To Use

Add this step into workflow

jobs:
  ...
  steps:

    - name: Set up Maven
      uses: stCarolas/setup-maven@v5
      with:
        maven-version: 3.8.2

Development using Docker

Clone this repository and build the project with command

docker run --rm -it -v "%PWD%:/usr/src/app" -w /usr/src/app node:12-alpine /bin/sh -c "npm i --no-bin-links && npm test && npm run build"

Note that %PWD% is the project working directory in Unix format, such as: /c/Users/source/repos/setup-maven

Analyze source code with SonarQube

Download SonarQube Docker image and start the server

docker pull sonarqube:community
docker run --rm -d --name docker-sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube

Login to http://localhost:9000/ using Administrator account (admin/admin) and configure the project to analyze. For more details, see: https://docs.sonarqube.org/latest/setup/get-started-2-minutes/

Run SonarScanner from the Docker image to analyze the project

docker run --rm -it --link docker-sonarqube -v "%PWD%:/usr/src/app" -w /usr/src/app ^
  -e "SONAR_HOST_URL=http://docker-sonarqube:9000" -e "SONAR_LOGIN=<projectToken>" sonarsource/sonar-scanner-cli ^
  -Dsonar.projectKey=setup-maven -Dsonar.language=js -Dsonar.sources=. "-Dsonar.exclusions=dist/**"