generated from readthedocs/tutorial-template
-
Notifications
You must be signed in to change notification settings - Fork 42
89 lines (74 loc) · 2.35 KB
/
linting.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Linting
on:
pull_request:
jobs:
prose:
runs-on: ubuntu-22.04 # See https://github.com/errata-ai/vale-action/issues/128 before upgrading
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'
- name: Install Python dependencies
run: pip3 install -r docs/requirements.txt
- name: Vale
uses: errata-ai/vale-action@reviewdog
with:
# Please keep version in sync with the version in .gitpod.Dockerfile for a consistent experience
version: 3.7.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'
- name: Install Python dependencies
run: pip3 install -r docs/requirements.txt
- name: Build docs
working-directory: docs
run: make html
- name: Check links
working-directory: docs
run: make checklinks
doctor_rst:
runs-on: ubuntu-latest
steps:
- name: Checkout Current Branch
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensures full history is fetched
- name: Extract base branch name
id: extract_base_branch
run: echo "branch=${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" >> $GITHUB_ENV
- name: Get changed files
id: changed_files
run: |
git fetch origin ${{ env.branch }}:refs/remotes/origin/${{ env.branch }}
git diff --name-only origin/${{ env.branch }}...HEAD > changed_files.txt
- name: "Create cache dir"
run: mkdir .cache
- name: "Cache DOCtor-RST"
uses: actions/cache@v3
with:
path: .cache
key: ${{ runner.os }}-doctor-rst-${{ env.branch }}
- name: "Run DOCtor-RST"
uses: docker://oskarstark/doctor-rst:1.61.1
with:
args: --short --error-format=github --cache-file=/github/workspace/.cache/doctor-rst.cache docs/
env:
DOCS_DIR: 'docs/'