Skip to content

Add version selector #645

Add version selector

Add version selector #645

Workflow file for this run

name: Document generation test with ruby/ruby
on:
pull_request:
push:
branches:
- master
concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
ruby_core:
name: Generate ruby/ruby documentation with the current RDoc commit
runs-on: ubuntu-latest
strategy:
fail-fast: false
timeout-minutes: 30
steps:
- name: Set up latest ruby head
uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0
with:
ruby-version: head
bundler: none
- name: Save latest buildable revision to environment
run: echo "REF=$(ruby -v | cut -d')' -f1 | cut -d' ' -f5)" >> $GITHUB_ENV
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0
with:
repository: ruby/ruby
path: ruby/ruby
fetch-depth: 10
- name: Checkout the latest buildable revision
run: git switch -c ${{ env.REF }}
working-directory: ruby/ruby
- name: Install libraries
run: |
set -x
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev bison autoconf ruby
- name: Build Ruby
run: |
# Download the required auxiliary files for autoconf
# This is necessary because autoconf 2.71+ (included in Ubuntu latest)
# fails with "cannot find required auxiliary files" error
# These files (config.guess and config.sub) are needed for system detection
ruby tool/downloader.rb -d tool -e gnu config.guess config.sub
autoconf
./configure -C --disable-install-doc
working-directory: ruby/ruby
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0
with:
path: ruby/rdoc
- name: Build RDoc locally
# The `build` task provided by `require 'bundler/gem_tasks'` seems to have a bug
# as described in https://github.com/rubygems/rubygems/issues/8477
# The manual `gem build` and `gem install` are used to work around this issue.
run: |
bundle install
gem build rdoc.gemspec
# This gem isn't used for generating Ruby documentation.
# This is just for fixing `pkg/rdoc-X.Y.Z.gem` path.
gem install rdoc-*.gem
bundle exec rake build:local_ruby
working-directory: ruby/rdoc
- name: Generate Documentation with RDoc
run: make html
working-directory: ruby/ruby
# We need to clear the generated documentation to generate them again
# with the Prism parser.
- name: Clear Generated Documentation
run: rm -r .ext/html
working-directory: ruby/ruby
- name: Generate Documentation with RDoc (Prism parser)
run: make html
working-directory: ruby/ruby
env:
RDOC_USE_PRISM_PARSER: true