-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 2.22 KB
/
sonar-scan.yml
File metadata and controls
57 lines (53 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Sonar Scanner
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
env:
QT_QPA_PLATFORM: offscreen
GLFW_CONTEXT_API: osmesa
strategy:
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
# - name: Install EGL dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y \
# libegl1 \
# libgl1 \
# libxkbcommon-x11-0 \
# libxcb-xinerama0
# - name: Install OpenGL (OSMesa)
# run: |
# sudo apt-get update
# sudo apt-get install -y \
# libgl1-mesa-dev \
# libosmesa6-dev \
# mesa-utils
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Install dependencies and run coverag
run: |
uv run coverage run --source=src/ncca/ngl --omit="*/tests/*,*/test_*" -m pytest -p no:pytest-qt tests --ignore=tests/test_shaderlib.py --ignore=tests/test_texture.py --ignore=tests/test_text.py --ignore=tests/test_base_mesh.py --ignore=tests/test_primitives.py --ignore=tests/test_obj.py --ignore=tests/test_vao.py --ignore=tests/test_lookat_widget.py --ignore=tests/test_transform_widget.py --ignore=tests/test_vec4_widget.py --ignore=tests/test_rgb_colour_widget.py --ignore=tests/test_vec2_widget.py --ignore=tests/test_rgba_colour_widget.py --ignore=tests/test_vec3_widget.py --ignore=tests/test_webgpu_widget.py && uv run coverage report -m
uv run coverage xml
# run: |
# uv run coverage run --source=src/ncca/ngl -m pytest && uv run coverage report -m && uv run coverage xml
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}