Skip to content

Commit 58e8488

Browse files
committed
Experiment with custom action
1 parent a834ddd commit 58e8488

File tree

2 files changed

+77
-16
lines changed

2 files changed

+77
-16
lines changed
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: 'Pulp Docs CI'
2+
description: 'Pulp Docs CI for repository members'
3+
4+
inputs:
5+
repository_name:
6+
description: 'The name of the repository CI owner'
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Verify repository checkout
13+
shell: bash
14+
run: |
15+
echo "$PWD"
16+
echo ${{ inputs.repository_name }}
17+
if [ ! -d "${{ inputs.repository_name }}/.git" ]; then
18+
echo "::error::The repository must be checked out before running this action."
19+
echo "::error::Please add the 'actions/checkout' step with path={repository_name}."
20+
exit 1
21+
fi
22+
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Checkout foo-docs repository
28+
uses: actions/checkout@v4
29+
with:
30+
repository: "pulp/pulp-docs"
31+
path: pulp-docs
32+
ref: "rewrite-as-mkdocs-plugin"
33+
34+
- name: "Install pulp-docs"
35+
shell: bash
36+
run: |
37+
cd pulp-docs
38+
pip install --upgrade pip
39+
pip install -r doc_requirements.txt
40+
41+
- name: "Build Docs"
42+
shell: bash
43+
run: |
44+
echo $PWD
45+
cd pulp-docs
46+
pulp-docs fetch --dest /tmp/pulp-docs-tmp
47+
pulp-docs build --path pulp-docs@..:${{ inputs.repository_name }}@..:/tmp/pulpdocs-tmp
48+

.github/workflows/pr.yml

+29-16
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,34 @@ concurrency:
99

1010
jobs:
1111
docs:
12-
uses: "./.github/workflows/docs.yml"
13-
14-
tests:
15-
uses: "./.github/workflows/tests.yml"
16-
17-
ready-to-ship:
18-
# This is a dummy dependent task to have a single entry for the branch protection rules.
1912
runs-on: "ubuntu-latest"
20-
needs:
21-
- "docs"
22-
- "tests"
23-
if: "always()"
2413
steps:
25-
- name: "Collect needed jobs results"
26-
run: |
27-
echo '${{toJson(needs)}}' | jq -r 'to_entries[]|select(.value.result!="success")|.key + ": " + .value.result'
28-
echo '${{toJson(needs)}}' | jq -e 'to_entries|map(select(.value.result!="success"))|length == 0'
29-
echo "CI says: Looks good!"
14+
- uses: "actions/checkout@v4"
15+
with:
16+
path: "pulp-docs"
17+
fetch-depth: 0
18+
19+
- run: |
20+
echo "$PWD"
21+
ls
22+
23+
- uses: "./pulp-docs/.github/actions/pulp-docs-ci"
24+
with:
25+
repository_name: "pulp-docs"
26+
27+
# tests:
28+
# uses: "./.github/workflows/tests.yml"
29+
30+
# ready-to-ship:
31+
# # This is a dummy dependent task to have a single entry for the branch protection rules.
32+
# runs-on: "ubuntu-latest"
33+
# needs:
34+
# - "docs"
35+
# - "tests"
36+
# if: "always()"
37+
# steps:
38+
# - name: "Collect needed jobs results"
39+
# run: |
40+
# echo '${{toJson(needs)}}' | jq -r 'to_entries[]|select(.value.result!="success")|.key + ": " + .value.result'
41+
# echo '${{toJson(needs)}}' | jq -e 'to_entries|map(select(.value.result!="success"))|length == 0'
42+
# echo "CI says: Looks good!"

0 commit comments

Comments
 (0)