-
Notifications
You must be signed in to change notification settings - Fork 65
72 lines (63 loc) · 2.1 KB
/
docstrings.yaml
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
name: Docstrings CI
on:
push:
branches:
- 'master'
- 'release/*'
tags:
- 'v*'
pull_request:
# Cancel any previous runs with the same key.
concurrency:
# Example key: Repository Structure CI-refs/pull/1381/merge
# or Repository Structure CI-<owner>-<sha> for pushes
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || format('{0}-{1}', github.repository_owner, github.sha) }}
cancel-in-progress: true
jobs:
python_docstrings:
runs-on: ${{matrix.os}}
strategy:
matrix:
os:
- ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
# We need history so that we have tags to provide version information.
fetch-depth: 0
# 0 fetches all history. See https://github.com/actions/checkout#checkout-v2
- name: Cache miniconda between builds
id: cache-miniconda
uses: actions/cache@v2
with:
key: ${{matrix.os}}-miniconda-${{hashFiles('.github/workflows/download_miniconda.sh')}}
path: ~/.cache/miniconda
- name: Install platform-level dependencies (OS-specific)
run: |
sudo apt install -yq curl
- name: Install Conda environment
run: .github/workflows/download_miniconda.sh ${{matrix.os}}
if: steps.cache-miniconda.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
. .github/workflows/activate_miniconda.sh
mamba install -y -q -c conda-forge black=19.10b0 pylint=2.8.3 pydocstyle=6.1.1
- name: Find changed Python files
uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.ref }}
list-files: shell
filters: |
python:
- added|modified: '!(docs/**)**.py'
- name: Check docstrings
run: |
if [ "${{ steps.filter.outputs.python }}" == "true" ]
then
. .github/workflows/activate_miniconda.sh
pydocstyle --config=./pyproject.toml ${{ steps.filter.outputs.python_files }}
else
echo "No Python files were changed."
fi