Skip to content

Commit

Permalink
Create coverage.yml, and add upload_coverage script
Browse files Browse the repository at this point in the history
  • Loading branch information
erunks committed Sep 18, 2020
1 parent 5355211 commit 1f2b16f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: [ master ]

jobs:
generate-and-upload-coverage:
runs-on: ubuntu-latest

if: github.event.pull_request.merged == true
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6

- name: Run setup
run: |
python3 -m pip install -r requirements.txt
python3 -m pip install -r requirements-dev.txt
- name: Generate coverage
run: |
chmod +x $GITHUB_WORKSPACE/scripts/generate_coverage.sh
sh $GITHUB_WORKSPACE/scripts/generate_coverage.sh
- name: Upload coverage
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: |
chmod +x $GITHUB_WORKSPACE/scripts/upload_coverage.sh
sh $GITHUB_WORKSPACE/scripts/upload_coverage.sh
2 changes: 2 additions & 0 deletions scripts/upload_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l Python -r coverage.xml

0 comments on commit 1f2b16f

Please sign in to comment.