Skip to content

Commit a275afe

Browse files
workfow added
1 parent 9aa12a8 commit a275afe

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
services:
13+
redis:
14+
image: redis
15+
ports:
16+
- 6379:6379
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: '3.6'
27+
28+
- name: Install dependencies
29+
run: |
30+
pip install -U setuptools pip
31+
pip install -e .[cpphash,redis,uwsgi]
32+
33+
- name: Run tests
34+
run: python setup.py test
35+
36+
- name: SonarQube Scan (Push)
37+
if: github.event_name == 'push'
38+
uses: SonarSource/sonarcloud-github-action@v1.5
39+
env:
40+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
41+
with:
42+
projectBaseDir: .
43+
args: >
44+
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
45+
-Dsonar.projectName=${{ github.event.repository.name }}
46+
-Dsonar.projectKey=${{ github.event.repository.name }}
47+
-Dsonar.python.coverage.reportPaths=coverage.xml
48+
-Dsonar.c.file.suffixes=-
49+
-Dsonar.cpp.file.suffixes=-
50+
-Dsonar.objc.file.suffixes=-
51+
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
52+
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
53+
54+
- name: SonarQube Scan (Pull Request)
55+
if: github.event_name == 'pull_request'
56+
uses: SonarSource/sonarcloud-github-action@v1.5
57+
env:
58+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
59+
with:
60+
projectBaseDir: .
61+
args: >
62+
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
63+
-Dsonar.projectName=${{ github.event.repository.name }}
64+
-Dsonar.projectKey=${{ github.event.repository.name }}
65+
-Dsonar.python.coverage.reportPaths=coverage.xml
66+
-Dsonar.c.file.suffixes=-
67+
-Dsonar.cpp.file.suffixes=-
68+
-Dsonar.objc.file.suffixes=-
69+
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
70+
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
71+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
72+
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
73+
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}

0 commit comments

Comments
 (0)