Skip to content

Create reusable workflow for components CI #122

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

Closed
Show file tree
Hide file tree
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
77 changes: 1 addition & 76 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,81 +17,6 @@ jobs:
path: "pulp-docs"
fetch-depth: 0

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulpcore"
path: "pulpcore"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp_ansible"
path: "pulp_ansible"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp_container"
path: "pulp_container"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp_deb"
path: "pulp_deb"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp_gem"
path: "pulp_gem"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp_maven"
path: "pulp_maven"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp_npm"
path: "pulp_npm"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp_ostree"
path: "pulp_ostree"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp_python"
path: "pulp_python"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp_rpm"
path: "pulp_rpm"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp-cli"
path: "pulp-cli"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp-ui"
path: "pulp-ui"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp-openapi-generator"
path: "pulp-openapi-generator"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp-oci-images"
path: "pulp-oci-images"

- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp-operator"
path: "pulp-operator"

- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
Expand All @@ -103,5 +28,5 @@ jobs:

- name: "Build docs"
run: |
mkdocs build
make docs
...
32 changes: 16 additions & 16 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ concurrency:

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

tests:
uses: "./.github/workflows/tests.yml"
# tests:
# uses: "./.github/workflows/tests.yml"

ready-to-ship:
# This is a dummy dependent task to have a single entry for the branch protection rules.
runs-on: "ubuntu-latest"
needs:
- "docs"
- "tests"
if: "always()"
steps:
- name: "Collect needed jobs results"
run: |
echo '${{toJson(needs)}}' | jq -r 'to_entries[]|select(.value.result!="success")|.key + ": " + .value.result'
echo '${{toJson(needs)}}' | jq -e 'to_entries|map(select(.value.result!="success"))|length == 0'
echo "CI says: Looks good!"
# ready-to-ship:
# # This is a dummy dependent task to have a single entry for the branch protection rules.
# runs-on: "ubuntu-latest"
# needs:
# - "docs"
# - "tests"
# if: "always()"
# steps:
# - name: "Collect needed jobs results"
# run: |
# echo '${{toJson(needs)}}' | jq -r 'to_entries[]|select(.value.result!="success")|.key + ": " + .value.result'
# echo '${{toJson(needs)}}' | jq -e 'to_entries|map(select(.value.result!="success"))|length == 0'
# echo "CI says: Looks good!"
40 changes: 40 additions & 0 deletions .github/workflows/pulp-docs-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Docs CI'
on:
workflow_call:

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

# 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"
fetch-depth: 0

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

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

- name: "Build Docs"
run: |
echo $PWD
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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
docs:
mkdocs build
pulp-docs fetch --dest /tmp/pulpdocs-tmp
pulp-docs build --path pulp-docs@..:/tmp/pulpdocs-tmp

.PHONY: docs