Skip to content

Commit d8eec97

Browse files
Merge pull request #238 from splitio/AUT-1159
workfow added
2 parents 9aa12a8 + dfc8e0c commit d8eec97

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/ci.yml

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

0 commit comments

Comments
 (0)