Release 3.1
#10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Coverage | |
on: [push] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
pip install setuptools pytest-cov | |
git clone https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }} | |
cd ${{ github.event.repository.name }}/Files | |
python setup.py install | |
- name: Run tests and generate coverage report | |
run: | | |
cd Files/tests | |
coverage run -m unittest unit.py | |
coverage report | |
coverage xml -o coverage.xml | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: unit-test | |
path: Files/tests/coverage.xml | |
send: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Retrieve coverage | |
uses: actions/download-artifact@v2 | |
- name: Coverage reporter | |
uses: codacy/codacy-coverage-reporter-action@v1.3.0 | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: unit-test/coverage.xml |