-
-
Notifications
You must be signed in to change notification settings - Fork 294
69 lines (65 loc) · 2.71 KB
/
docstring-coverage.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
################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. #
# #
# Date: 14-03-2021 #
# Author(s): Gabriele Graffieti #
# E-mail: [email protected] #
# Website: avalanche.continualai.org #
################################################################################
name: docstring coverage
on:
push:
paths:
- '**.py'
- '.github/workflows/docstring-coverage.yml'
pull_request:
paths:
- '**.py'
- '.github/workflows/docstring-coverage.yml'
jobs:
build:
name: docstring coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64
- name: Install and use interrogate
run: |
pip install interrogate &&
interrogate avalanche -vv --generate-badge interrogate-badge.svg -o documentation-coverage.txt
- name: clone reports repository
if: github.event_name == 'push' && github.repository == 'ContinualAI/avalanche'
uses: actions/checkout@v2
with:
repository: 'ContinualAI/avalanche-report'
ref: main
path: 'avalanche-reports'
token: ${{ secrets.REPORT_TOKEN }}
- name: commit badge
if: github.event_name == 'push' && github.repository == 'ContinualAI/avalanche'
run: |
mv interrogate-badge.svg avalanche-reports/badge/ &&
mv documentation-coverage.txt avalanche-reports/docstring_coverage/ &&
cd avalanche-reports &&
git config --local user.email ${{ secrets.EMAIL }} &&
git config --local user.name ${{ secrets.NAME }} &&
git pull &&
git add . &&
git commit -m "Update coverage badge" -a || true
- name: Push changes
if: github.event_name == 'push' && github.repository == 'ContinualAI/avalanche'
continue-on-error: true
uses: ad-m/github-push-action@master
with:
repository: ContinualAI/avalanche-report
branch: main
directory: avalanche-reports
github_token: ${{ secrets.REPORT_TOKEN }}