-
Notifications
You must be signed in to change notification settings - Fork 264
188 lines (177 loc) · 5.07 KB
/
CI.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: CI
on: [pull_request, push]
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
build-pdf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'
- name: Install Python Dependencies
run: |
pip install -r source/requirements.txt
- name: Install LaTeX
run: |
sudo apt-fast -y update
sudo apt-fast install -y texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra latexmk texlive-lang-greek texlive-luatex texlive-xetex texlive-fonts-extra dvipng librsvg2-bin
- name: Build PDF
run: |
make latexpdf
- name: Archive PDF
uses: actions/upload-artifact@v3
with:
name: frc-docs-pdf
path: build/latex/firstroboticscompetition.pdf
if-no-files-found: error
build-html:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'
- name: Install Python Dependencies
run: |
pip install -r source/requirements.txt
- name: Install librsvg2
run: |
sudo apt-fast -y update
sudo apt-fast install -y librsvg2-bin
- name: Build HTML
run: |
make html
- name: Archive HTML
uses: actions/upload-artifact@v3
with:
name: frc-docs-html
path: build/html/
if-no-files-found: error
build-html-translation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: wpilibsuite/frc-docs-translations
- name: Delete old submodule
run: |
rm -rf ./frc-docs
- uses: actions/checkout@v3
with:
path: frc-docs
- uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'
- name: Install Python Dependencies
run: |
pip install -r frc-docs/source/requirements.txt
- name: Install librsvg2
run: |
sudo apt-fast -y update
sudo apt-fast install -y librsvg2-bin
- name: Build HTML
run: |
sphinx-build -D language=es -b html . _build/html
link-check-diff:
# This job is sourced from https://github.com/aiven/devportal/blob/main/.github/workflows/linkcheck-changed-files.yaml
# It is CC 4.0 I licensed: https://creativecommons.org/licenses/by/4.0/
# Changes have been made.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Dependencies
run: pip install -r source/requirements.txt
- name: Run linkcheck on .rst files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if [ "${file: -4}" == ".rst" ]
then
var="$var $file"
fi
done
if [ -z "$var" ]
then
echo "No *.rst changed files to check."
else
make BUILDER_ARGS="$var" linkcheck
fi
check-linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Dependencies
run: |
pip install -r source/requirements.txt
- name: Check Lint
run: |
make lint
check-image-size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Dependencies
run: |
pip install -r source/requirements.txt
- name: Check Image Size
run: |
make sizecheck
check-spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: misspell
uses: reviewdog/action-misspell@v1
with:
locale: "US"
reporter: "github-check"
check-redirects:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout main
run: |
git fetch origin main --depth=1
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Dependencies
run: |
pip install -r source/requirements.txt
- name: Check redirects
run: |
make rediraffecheckdiff
- name: Check redirects format
run: |
[[ $(<source/redirects.txt) == $(git show origin/main:source/redirects.txt)* ]] || { echo "Error: redirects.txt can only be appended to. Lines cannot be modified or deleted."; exit 1; }
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Python Dependencies
run: |
pip install -r source/requirements.txt
- name: Format
run: |
black --check .