name: SonarCloud

on:
  push:
    branches:
      - master
    pull_requests:
      types: [opened, synchronize, reopened]

jobs:
  sonarcloud:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0  # Disabling shallow clone is recommended for improving relevancy of reporting
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.9.0'
    - name: Collector
      run: |
        sudo apt-get install libxml2-dev libxslt-dev python-dev
        cd components/collector
        python -m pip install --upgrade pip
        python -m pip install wheel
        pip install -r requirements.txt -r requirements-dev.txt
        ci/unittest.sh
        nosetests --nocapture --with-xunit --xunit-file=build/nosetests.xml tests
    - name: Notifier
      run: |
        cd components/notifier
        python -m pip install --upgrade pip
        pip install -r requirements.txt -r requirements-dev.txt
        ci/unittest.sh
        nosetests --nocapture --with-xunit --xunit-file=build/nosetests.xml tests
    - name: SonarQube scan
      uses: sonarsource/sonarcloud-github-action@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

name: SonarCloud

on:
  push:
    branches:
      - master
    pull_requests:
      types: [opened, synchronize, reopened]

jobs:
  sonarcloud:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0  # Disabling shallow clone is recommended for improving relevancy of reporting
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.9.0'
    - name: Prerequisites
      run: |
        sudo apt-get install libxml2-dev libxslt-dev python-dev
        python -m pip install --upgrade pip
        python -m pip install wheel
    - name: Collector
      run: |
        cd components/collector
        pip install -r requirements.txt -r requirements-dev.txt
        ci/unittest.sh
        nosetests --nocapture --with-xunit --xunit-file=build/nosetests.xml tests
    - name: Notifier
      run: |
        cd components/notifier
        pip install -r requirements.txt -r requirements-dev.txt
        ci/unittest.sh
        nosetests --nocapture --with-xunit --xunit-file=build/nosetests.xml tests
    - name: Server
      run: |
        cd components/server
        pip install -r requirements.txt -r requirements-dev.txt
        ci/unittest.sh
        nosetests --nocapture --with-xunit --xunit-file=build/nosetests.xml tests
    - name: SonarQube scan
      uses: sonarsource/sonarcloud-github-action@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Add server to SonarCloud action.
Add server to SonarCloud action.
