Skip to content

Commit

Permalink
Add SonarCloud scan workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Cirras committed Nov 6, 2023
1 parent 1340365 commit 14bd9e1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Sonar

on:
push:
branches:
- master

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install Hatch
run: pip install --upgrade hatch

- name: Run tests
run: hatch run test

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![PyPI - Version](https://img.shields.io/pypi/v/eolib.svg)](https://pypi.org/project/eolib)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/eolib.svg)](https://pypi.org/project/eolib)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Cirras_eolib-python&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Cirras_eolib-python)

A core Python library for writing applications related to Endless Online.

Expand Down
12 changes: 12 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sonar.organization=cirras
sonar.projectKey=Cirras_eolib-python

sonar.tests=tests

sonar.coverage.exclusions= \
protocol.py, \
protocol_build_hook.py, \
protocol_code_generator/**/*, \
src/eolib/protocol/_generated/**/*

sonar.python.coverage.reportPaths=coverage.xml

0 comments on commit 14bd9e1

Please sign in to comment.