forked from open-atmos/PySDM
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (67 loc) · 2.48 KB
/
precommit.yml
File metadata and controls
82 lines (67 loc) · 2.48 KB
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
73
74
75
76
77
78
79
80
81
82
name: precommit, url-check and devops tests
defaults:
run:
shell: bash
env:
# common options for pytest
pytest_options: "--durations=10 -v -s -We -p no:unraisableexception"
on:
push:
branches: [ main ]
paths: ['docs/**', '**.md']
pull_request:
branches: [ main ]
schedule:
- cron: '0 13 * * 4'
jobs:
precommit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.1.6
- uses: actions/setup-python@v5.0.0
with:
python-version: "3.10"
- run: |
pip install pre-commit
pre-commit clean
pre-commit autoupdate
pre-commit run --all-files
- if: ${{ failure() }}
run: git diff
devops:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.1.6
with:
submodules: recursive
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480
- run: pip install -r tests/devops_tests/requirements.txt
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pytest ${{ env.pytest_options }} -k "not test_run_notebooks" tests/devops_tests
url-check:
runs-on: ubuntu-24.04
continue-on-error: true
steps:
- uses: actions/checkout@v4.1.6
- name: URLs-checker
uses: urlstechie/urlchecker-action@master
with:
# A subfolder or path to navigate to in the present or cloned repository
# subfolder: docs
# A comma-separated list of file types to cover in the URL checks
file_types: .md,.py,.json,.ipynb,.yaml,.yml,.jinja2,.toml
# Choose whether to include file with no URLs in the prints.
print_all: false
# Choose whether to print a more verbose end summary with files and broken URLs.
verbose: true
# The timeout seconds to provide to requests, defaults to 5 seconds
timeout: 7
# How many times to retry a failed request (each is logged, defaults to 1)
retry_count: 3
# A comma separated links to exclude during URL checks
exclude_urls: https://www.gnu.org/licenses/gpl-3.0.html,https://open-atmos.github.io/PySDM/\2/\3.html
# A comma separated patterns to exclude during URL checks
exclude_patterns: http://purl.org,http://www.w3.org,https://doi.org/10.1175/
# A comma separated list of file patterns (direct paths work as well) to exclude
exclude_files: docs/generate_html.py,.github/workflows/precommit.yml