-
Notifications
You must be signed in to change notification settings - Fork 13
55 lines (52 loc) · 1.26 KB
/
sonar-cloud.yml
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
name: Check coverage
on:
push:
branches:
- main
- dev
paths:
- bin/**
- src/**
- tests/**
- setup.py
- pyproject.toml
- .github/workflows/**
pull_request:
branches:
- main
- dev
paths:
- bin/**
- src/**
- tests/**
- setup.py
- pyproject.toml
- .github/workflows/**
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install nplinker and its dependencies
run: |
python3 -m pip install -e .[dev]
install-nplinker-deps --run-on-github
- name: Run unit tests with coverage
run: pytest --cov=nplinker --cov-report=xml --cov-report=term tests/unit
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN }}