I have confirmed that the project folder is accessable and sonarqube use it. Because if i change the folder to something not exists or make it empty sonarqube throws an exception which tell me that the folder is missing. In exactly this folder lays the configuration file.
The Job Configuration:
name: Node CI
on: [push, pull_request]
jobs:
build:
name: Test
runs-on: self-hosted
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@master
with:
node-version: '10.x'
- uses: webfactory/ssh-agent@v0.4.0
with:
ssh-private-key: ${{ secrets.private_ssh }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # used to check for cache-hit: if: steps.yarn-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Check style
run: yarn run lint
- name: Run tests
run: yarn run test-coverage
sonarCloudTrigger:
needs: build
name: SonarCloud Trigger
runs-on: self-hosted
steps:
- name: Clone Repository
uses: actions/checkout@master
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
And the sonar-project.properties (escaped sensitive infos)
sonar.projectKey=---projectkey---
sonar.organization=--organization--
sonar.sourceEncoding=UTF-8
sonar.projectName=--name--
sonar.links.homepage=https://----.de
sonar.javascript.file.suffixes=.js,.jsx
sonar.links.ci=https://github.com/-------/actions
sonar.links.issue=https://github.com/----/issues
sonar.links.scm=https://github.com/----
sonar.sources=src
sonar.tests=src
sonar.test.inclusions=**/*.test.*
sonar.testExecutionReportPaths=test-report.xml
sonar.javascript.lcov.reportPaths=coverage/lcov.info