-
Notifications
You must be signed in to change notification settings - Fork 12
52 lines (49 loc) · 1.39 KB
/
build.yml
File metadata and controls
52 lines (49 loc) · 1.39 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
name: Build Connect Python SDK
on:
push:
branches: "*"
tags:
- '*'
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/test.txt
pip install -r requirements/sdk.txt
pip install pytest-cov
- name: Linting
run: |
flake8 connect
- name: Testing
run: |
pytest --cov-report=xml --cov=./connect
sed -i "s/version='0.0.0'/version='${TRAVIS_TAG}'/g" setup.py
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true
verbose: true
- name: Fix coverage report for Sonar
run: |
sed -i 's/\/home\/runner\/work\/connect-python-sdk\/connect-python-sdk\//\/github\/workspace\//g' coverage.xml
- name: SonarCloud
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}