Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ReportCoverage.yml #25

Merged
merged 5 commits into from
Oct 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ReportCoverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Code Climate reporting

on:
pull_request:
branches: [ main ]

jobs:
codeclimate:
runs-on: ubuntu-latest
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GOOGLE_CREDS: ${{ secrets.GOOGLE_CREDS }}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage pytest
if [ -f project/requirements.txt ]; then pip install -r project/requirements.txt; fi
- name: Pre-build Report
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Test with pytest and capture coverage report
run: |
coverage run -m pytest
- name: Change ./.coverage to ./coverage.xml
run: |
coverage xml
- name: change coverage.xml to coverage/codeclimate.json
run: |
./cc-test-reporter format-coverage ./coverage.xml --input-type=coverage.py
- name: Upload the test coverage to code climate
run: |
./cc-test-reporter upload-coverage