Skip to content

Commit f4d1781

Browse files
committed
Add GitHub meta information: dependabot, pull request template, and CI.
1 parent 39b1cd1 commit f4d1781

File tree

6 files changed

+137
-0
lines changed

6 files changed

+137
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!--
2+
The type of content accepted into the documentation is explained here:
3+
https://contributing.godotengine.org/en/latest/documentation/contributing_to_the_contributing_docs.html
4+
-->

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "pip"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"
11+
ignore:
12+
# We need to decide on when we upgrade Sphinx manually,
13+
# as historically, this has been proven to often imply larger changes
14+
# (RTD compat, upgrading extensions, other dependencies, our content, etc.).
15+
- dependency-name: "sphinx"

.github/workflows/check_urls.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 🌐 Check URLs
2+
on:
3+
schedule:
4+
# Every Friday at 16:27 UTC.
5+
# URLs can decay over time. Setting up a schedule makes it possible to be warned
6+
# about dead links as soon as possible.
7+
- cron: "27 16 * * FRI"
8+
9+
jobs:
10+
check-urls:
11+
runs-on: ubuntu-24.04
12+
steps:
13+
14+
- uses: actions/checkout@v5
15+
16+
- name: Restore lychee cache
17+
uses: actions/cache@v4
18+
with:
19+
path: .lycheecache
20+
key: cache-lychee-${{ github.sha }}
21+
restore-keys: cache-lychee-
22+
23+
- name: Run lychee
24+
uses: lycheeverse/lychee-action@v2
25+
with:
26+
args: >
27+
--base .
28+
--no-progress
29+
--cache
30+
--max-cache-age 1d
31+
--exclude-path _templates/
32+
--exclude-path classes/
33+
"**/*.md" "**/*.html" "**/*.rst"
34+
35+
- name: Fail if there were link errors
36+
run: exit ${{ steps.lc.outputs.exit_code }}

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Continuous integration
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-24.04
14+
timeout-minutes: 120
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v5
18+
19+
- name: Style checks via pre-commit
20+
uses: pre-commit/[email protected]
21+
22+
- name: Custom RST checks (check-rst.sh)
23+
run: |
24+
bash ./_tools/check-rst.sh
25+
26+
- name: Get Python version
27+
id: pythonv
28+
run: |
29+
echo "PYTHON_VERSION=$(python --version)" >> $GITHUB_OUTPUT
30+
31+
- name: Restore cached virtualenv
32+
uses: actions/cache/restore@v4
33+
with:
34+
key: venv-${{ runner.os }}-${{ steps.pythonv.outputs.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }}
35+
path: .venv
36+
37+
- name: Install dependencies
38+
run: |
39+
python -m venv .venv
40+
source .venv/bin/activate
41+
python -m pip install -r requirements.txt
42+
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
43+
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
44+
45+
- name: Save virtualenv cache
46+
uses: actions/cache/save@v4
47+
with:
48+
key: venv-${{ runner.os }}-${{ steps.pythonv.outputs.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }}
49+
path: .venv
50+
51+
# Use dummy builder to improve performance as we don't need the generated HTML in this workflow.
52+
- name: Sphinx build
53+
run: |
54+
source .venv/bin/activate
55+
make SPHINXOPTS='--color -j 4 -W' dummy

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
default_language_version:
2+
python: python3
3+
4+
repos:
5+
- repo: https://github.com/codespell-project/codespell
6+
rev: v2.3.0
7+
hooks:
8+
- id: codespell
9+
files: ^(about|community|engine_details|getting_started|tutorials)/.*\.rst$
10+
additional_dependencies: [tomli]
11+
12+
- repo: https://github.com/pre-commit/pre-commit-hooks
13+
rev: v5.0.0
14+
hooks:
15+
- id: fix-byte-order-marker
16+
- id: mixed-line-ending
17+
args: ['--fix=lf']

_tools/check-rst.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -uo pipefail
4+
5+
output=$(grep -r -P '^(?!\s*\.\.).*\S::$' --include='*.rst' --exclude='docs_writing_guidelines.rst' .)
6+
if [[ -n $output ]]; then
7+
echo 'The shorthand codeblock syntax (trailing `::`) is not allowed.'
8+
echo "$output"
9+
exit 1
10+
fi

0 commit comments

Comments
 (0)