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

feat: Added sonarcloud Github Action #1243

Closed
wants to merge 5 commits into from
Closed
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
45 changes: 45 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

name: SonarCloud Analysis

on:
push:
branches:
- '**'
pull_request:
branches:
- 'main'
- 'develop'
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no develop branch on open-scd. This can be removed

pull_request_target:
branches:
- 'main'
- 'develop'
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no develop branch on open-scd. This can be removed


jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 15

if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=openscd
-Dsonar.projectKey=openscd_open-scd
-Dsonar.javascript.coverage.reportPaths=coverage/lcov.info
-Dsonar.sources=src/
-Dsonar.test.exclusions=test/**
-Dsonar.tests=test/
-Dsonar.verbose=true
Loading