Skip to content

Experiment reusable ci workflow #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: rewrite-as-mkdocs-plugin
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'Docs CI'

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Instructions to run locally
shell: bash
run: |
cat <<EOL
To run this locally, make sure:
1. You have pulp-docs and your plugin checkout in the same dir.
2. You have the latest pulp-docs availabe in your python environment

Then run:

cd pulp-docs
pulp-docs fetch --dest /tmp/pulp-docs-tmp
pulp-docs build --path pulp-docs@..:${{ github.event.repository.name }}@..:/tmp/pulp-docs-tmp

EOL

# The caller repository and context is used
- name: Checkout CI repository
if: ${{ github.event.repository.name != 'pulp-docs' }}
uses: actions/checkout@v4
with:
path: ${{ github.event.repository.name }}

- name: Checkout pulp-docs repository
uses: actions/checkout@v4
with:
repository: "pulp/pulp-docs"
path: pulp-docs
# ref: "rewrite-as-mkdocs-plugin"
# TODO: revert. using this because pulpcore-selinux is not included in rewrite-as-mkdocs-plugin
ref: "experiment-reusable-ci-workflow"
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: "Install pulp-docs"
working-directory: "pulp-docs"
run: |
pip install --upgrade pip
pip install -r doc_requirements.txt

- name: "Build Docs"
working-directory: "pulp-docs"
run: |
pulp-docs fetch --dest /tmp/pulp-docs-tmp
pulp-docs build --path pulp-docs@..:${{ github.event.repository.name }}@..:/tmp/pulp-docs-tmp

- name: "Sanity Check"
working-directory: "pulp-docs"
shell: bash
run: |
echo "Checking that the namespace for the component under CI exists in the built docs."
ls "site/${{ github.event.repository.name }}/docs"
107 changes: 0 additions & 107 deletions .github/workflows/docs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ concurrency:

jobs:
docs:
uses: "./.github/workflows/docs.yml"
uses: ./.github/workflows/docs-ci.yml

tests:
uses: "./.github/workflows/tests.yml"
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -135,6 +135,10 @@ plugins:
git_url: "https://github.com/pulp/pulpcore"
kind: "Other"
# rest_api: "certguard"
- title: "Selinux"
path: "pulpcore-selinux"
git_url: "https://github.com/pulp/pulpcore-selinux"
kind: "Other"

- title: "Pulp OCI Images"
path: "pulp-oci-images"