-
Notifications
You must be signed in to change notification settings - Fork 29
103 lines (100 loc) · 3.38 KB
/
build-qa.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Rosey the Robot
on: [push, pull_request, release]
jobs:
build:
name: Quality Check
runs-on: Ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install Requirements and Dependencies
run: |
pip install --upgrade pip setuptools
pip install -e .[test]
- name: Prepare Environment
run: |
rm -rf .coverage
coverage erase
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Run Tests and Generate Coverage Results
run: |
pytest --cov=pkt_kg --cov-report xml:coverage.xml
coverage report
coverage xml
python-codacy-coverage -r coverage.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
- name: Linting with Mypy
run: mypy --strict-optional pkt_kg
- name: Sonar Cloud Scanner
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Codacy
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
- name: Code Climate
uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Coveralls
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# publish_docker_container:
# if: github.event_name == 'push'
# needs: build
# name: Push Docker Image to Docker Hub
# runs-on: ubuntu-latest
# steps:
# - name: Set-up QEMU
# uses: docker/setup-qemu-action@v2
# - name: Set-up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Build and Push Container to DockerHub
# id: docker_build
# uses: docker/build-push-action@v4
# with:
# push: true
# tags: callahantiff/pheknowlator:latest
# - name: Image Digest
# run: echo ${{ steps.docker_build.outputs.digest }}
publish_pypi_library:
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
needs: build
name: Publishes pkt_kg to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.6.15
- name: Install Requirements and Dependencies
run: pip install --upgrade pip setuptools wheel
- name: Create Package Distribution
run: python setup.py sdist bdist_wheel
- name: Publish Package to PyPi
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
skip_existing: true