Skip to content

Commit 37e991b

Browse files
committed
[DOC] Use the specified revision RDoc
1 parent 814eaf3 commit 37e991b

1 file changed

Lines changed: 34 additions & 7 deletions

File tree

.github/workflows/check_misc.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,11 @@ jobs:
6161
exit $fail
6262
working-directory: include
6363

64-
- name: Generate docs
65-
id: docs
64+
- name: Check if to generate documents
65+
id: rdoc
6666
run: |
67-
$RDOC -C -x ^ext -x ^lib .
68-
$RDOC --op html .
69-
echo htmlout=ruby-html-${GITHUB_SHA:0:10} >> $GITHUB_OUTPUT
70-
env:
71-
RDOC: ruby -W0 --disable-gems tool/rdoc-srcdir -q
67+
ref=$(sed 's/#.*//;/^rdoc /!d' gems/bundled_gems | awk '{print $4}')
68+
echo ref=$ref >> $GITHUB_OUTPUT
7269
# Generate only when document commit/PR
7370
if: >-
7471
${{false
@@ -80,6 +77,36 @@ jobs:
8077
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
8178
}}
8279
80+
- name: Checkout rdoc
81+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
82+
with:
83+
repository: ruby/rdoc
84+
ref: ${{ steps.rdoc.outputs.ref }}
85+
path: .bundle/gems/rdoc-0
86+
if: ${{ steps.rdoc.outputs.ref != '' }}
87+
88+
- name: Generate rdoc
89+
run: |
90+
set -x
91+
gempath=$(ruby -e 'print Gem.user_dir, "/bin"')
92+
PATH=$gempath:$PATH
93+
gem install --user bundler
94+
bundle config --local path vendor/bundle
95+
bundle install --jobs 4
96+
bundle exec rake generate
97+
working-directory: .bundle/gems/rdoc-0
98+
if: ${{ steps.rdoc.outputs.ref != '' }}
99+
100+
- name: Generate docs
101+
id: docs
102+
run: |
103+
$RDOC -C -x ^ext -x ^lib .
104+
$RDOC --op html .
105+
echo htmlout=ruby-html-${GITHUB_SHA:0:10} >> $GITHUB_OUTPUT
106+
env:
107+
RDOC: ruby -W0 --disable-gems tool/rdoc-srcdir -q
108+
if: ${{ steps.rdoc.outcome == 'success' }}
109+
83110
- name: Upload docs
84111
uses: actions/upload-artifact@v4
85112
with:

0 commit comments

Comments
 (0)