forked from cloudblue/connect-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (51 loc) · 1.45 KB
/
deploy.yml
File metadata and controls
53 lines (51 loc) · 1.45 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
name: Deploy Connect Python SDK
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- 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
pip install twine
- 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 }}
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*