Skip to content

Commit cb7e71f

Browse files
committed
WIP Adjust ci
1 parent 2182f88 commit cb7e71f

File tree

8 files changed

+128
-24
lines changed

8 files changed

+128
-24
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: "Build"
23

34
on:
@@ -11,7 +12,7 @@ jobs:
1112
- name: "Set up Python"
1213
uses: "actions/setup-python@v5"
1314
with:
14-
python-version: "3.11"
15+
python-version: "3.12"
1516
- name: "Install python dependencies"
1617
run: |
1718
pip install build setuptools wheel
@@ -25,3 +26,4 @@ jobs:
2526
path: |
2627
dist/
2728
if-no-files-found: "error"
29+
...

.github/workflows/docs.yml

Lines changed: 104 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,122 @@
1+
---
12
name: "Docs Test"
23

34
on:
45
workflow_call:
56

7+
defaults:
8+
run:
9+
working-directory: "pulp-docs"
10+
611
jobs:
7-
run-test:
12+
build-docs:
813
runs-on: "ubuntu-latest"
914
steps:
1015
- uses: "actions/checkout@v4"
16+
with:
17+
path: "pulp-docs"
18+
fetch-depth: 0
19+
20+
- uses: "actions/checkout@v4"
21+
with:
22+
repository: "pulp/pulpcore"
23+
branch: "main"
24+
path: "pulpcore"
25+
26+
- uses: "actions/checkout@v4"
27+
with:
28+
repository: "pulp/pulp_ansible"
29+
branch: "main"
30+
path: "pulp_ansible"
31+
32+
- uses: "actions/checkout@v4"
33+
with:
34+
repository: "pulp/pulp_container"
35+
branch: "main"
36+
path: "pulp_container"
37+
38+
- uses: "actions/checkout@v4"
39+
with:
40+
repository: "pulp/pulp_deb"
41+
branch: "main"
42+
path: "pulp_deb"
43+
44+
- uses: "actions/checkout@v4"
45+
with:
46+
repository: "pulp/pulp_gem"
47+
branch: "main"
48+
path: "pulp_gem"
49+
50+
- uses: "actions/checkout@v4"
51+
with:
52+
repository: "pulp/pulp_maven"
53+
branch: "main"
54+
path: "pulp_maven"
55+
56+
- uses: "actions/checkout@v4"
57+
with:
58+
repository: "pulp/pulp_npm"
59+
branch: "main"
60+
path: "pulp_npm"
61+
62+
- uses: "actions/checkout@v4"
63+
with:
64+
repository: "pulp/pulp_ostree"
65+
branch: "main"
66+
path: "pulp_ostree"
67+
68+
- uses: "actions/checkout@v4"
69+
with:
70+
repository: "pulp/pulp_python"
71+
branch: "main"
72+
path: "pulp_python"
73+
74+
- uses: "actions/checkout@v4"
75+
with:
76+
repository: "pulp/pulp_rpm"
77+
branch: "main"
78+
path: "pulp_rpm"
79+
80+
- uses: "actions/checkout@v4"
81+
with:
82+
repository: "pulp/pulp-cli"
83+
branch: "main"
84+
path: "pulp-cli"
85+
86+
- uses: "actions/checkout@v4"
87+
with:
88+
repository: "pulp/pulp-ui"
89+
branch: "main"
90+
path: "pulp-ui"
91+
92+
- uses: "actions/checkout@v4"
93+
with:
94+
repository: "pulp/pulp-openapi-generator"
95+
branch: "main"
96+
path: "pulp-openapi-generator"
97+
98+
- uses: "actions/checkout@v4"
99+
with:
100+
repository: "pulp/pulp-oci-images"
101+
branch: "main"
102+
path: "pulp-oci-images"
103+
104+
- uses: "actions/checkout@v4"
105+
with:
106+
repository: "pulp/pulp-operator"
107+
branch: "main"
108+
path: "pulp-operator"
109+
11110
- name: "Set up Python"
12111
uses: "actions/setup-python@v5"
13112
with:
14-
python-version: "3.11"
113+
python-version: "3.12"
15114

16115
- name: "Install Test Dependencies"
17116
run: |
18117
pip install -r doc_requirements.txt
19118
20-
- name: Build docs
119+
- name: "Build docs"
21120
run: |
22-
make docs
121+
mkdocs build
122+
...

.github/workflows/pr.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@ concurrency:
88
cancel-in-progress: true
99

1010
jobs:
11-
build:
12-
uses: "./.github/workflows/build.yml"
13-
1411
docs:
15-
needs:
16-
- "build"
1712
uses: "./.github/workflows/docs.yml"
1813

1914
tests:
20-
needs: "build"
2115
uses: "./.github/workflows/tests.yml"
2216

2317
ready-to-ship:

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: "Set up Python"
1212
uses: "actions/setup-python@v5"
1313
with:
14-
python-version: "3.11"
14+
python-version: "3.12"
1515

1616
- name: "Install Test Dependencies"
1717
run: |

.github/workflows/update-data.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: "Set up Python"
2020
uses: "actions/setup-python@v5"
2121
with:
22-
python-version: "3.11"
22+
python-version: "3.12"
2323

2424
- name: "List requirements"
2525
run: |

mkdocs.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,14 @@ plugins:
8484
rest_api: "gem"
8585
- title: "Maven"
8686
path: "pulp_maven"
87-
git_url: "https://github.com/pulp/pulp_python"
87+
git_url: "https://github.com/pulp/pulp_maven"
8888
kind: "Content"
89-
rest_api: "python"
89+
rest_api: "maven"
9090
- title: "NPM"
9191
path: "pulp_npm"
9292
git_url: "https://github.com/pulp/pulp_npm"
9393
kind: "Content"
9494
rest_api: "npm"
95-
- title: "RPM"
96-
path: "pulp_rpm"
97-
git_url: "https://github.com/pulp/pulp_rpm"
98-
kind: "Content"
99-
rest_api: "rpm"
10095
- title: "OSTree"
10196
path: "pulp_ostree"
10297
git_url: "https://github.com/pulp/pulp_ostree"
@@ -107,6 +102,11 @@ plugins:
107102
git_url: "https://github.com/pulp/pulp_python"
108103
kind: "Content"
109104
rest_api: "python"
105+
- title: "RPM"
106+
path: "pulp_rpm"
107+
git_url: "https://github.com/pulp/pulp_rpm"
108+
kind: "Content"
109+
rest_api: "rpm"
110110

111111
#TODO Fix cli code paths for docstrings
112112
- title: "Pulp CLI"

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies = [
1616
"mkdocs-literate-nav~=0.6.1",
1717
"httpx",
1818
"rich",
19+
"GitPython~=3.1.44",
1920
]
2021

2122
[project.scripts]

src/pulp_docs/plugin.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import yaml
66

77
import httpx
8-
from git import Repo
8+
from git import Repo, GitCommandError
99
from mkdocs.config import Config, config_options
1010
from mkdocs.config.defaults import MkDocsConfig
1111
from mkdocs.plugins import event_priority, get_plugin_logger, BasePlugin
@@ -314,9 +314,16 @@ def on_files(self, files: Files, /, *, config: MkDocsConfig) -> Files | None:
314314
)
315315
)
316316
repository_nav.add(src_uri)
317-
api_json = pulp_docs_git_repository.git.show(
318-
f"docs-data:data/openapi_json/{repository.rest_api}-api.json"
319-
)
317+
try:
318+
api_json = pulp_docs_git_repository.git.show(
319+
f"docs-data:data/openapi_json/{repository.rest_api}-api.json"
320+
)
321+
except GitCommandError:
322+
# Try again on the first remote.
323+
remote = pulp_docs_git_repository.remotes[0]
324+
api_json = pulp_docs_git_repository.git.show(
325+
f"{remote}/docs-data:data/openapi_json/{repository.rest_api}-api.json"
326+
)
320327
src_uri = (repository_dir / "api.json").relative_to(
321328
repository_parent_dir
322329
)

0 commit comments

Comments
 (0)