Include more Ruby metadata files

- include `.ruby-version` and in the project root (and unignore in
  `.gitignore`) to improve editor support which expects these files
- use the `.ruby-version` in `docs/Gemfile` to use a consistent Ruby
  version here
- remove hardcoded Ruby versions from `workflows/docs` in favour of
  using the `.ruby-version` file instead
- use more consistent configuration in `workflows/docs` to match
  `workflows/tests`
This commit is contained in:
Mike McQuaid 2024-05-23 16:29:14 +01:00
parent 93eb5ea04e
commit 3392226a10
No known key found for this signature in database
5 changed files with 15 additions and 4 deletions

View File

@ -9,6 +9,13 @@ on:
permissions: permissions:
contents: read contents: read
env:
HOMEBREW_DEVELOPER: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_ENV_HINTS: 1
HOMEBREW_BOOTSNAP: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
jobs: jobs:
linting: linting:
if: github.repository == 'Homebrew/brew' if: github.repository == 'Homebrew/brew'
@ -45,7 +52,6 @@ jobs:
- name: Install Ruby - name: Install Ruby
uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1 uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with: with:
ruby-version: "3.1"
bundler-cache: true bundler-cache: true
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}/docs working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}/docs
@ -85,8 +91,8 @@ jobs:
- name: Install Ruby - name: Install Ruby
uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1 uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with: with:
ruby-version: "3.1"
bundler-cache: true bundler-cache: true
working-directory: rubydoc
- name: Process rubydoc comments - name: Process rubydoc comments
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}/Library/Homebrew working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}/Library/Homebrew

5
.gitignore vendored
View File

@ -173,9 +173,10 @@
!/.editorconfig !/.editorconfig
!/.gitignore !/.gitignore
!/.irb_config !/.irb_config
!/.yardopts !/.ruby-version
!/.vale.ini
!/.shellcheckrc !/.shellcheckrc
!/.vale.ini
!/.yardopts
!/CHANGELOG.md !/CHANGELOG.md
!/CONTRIBUTING.md !/CONTRIBUTING.md
!/Dockerfile !/Dockerfile

1
.ruby-version Normal file
View File

@ -0,0 +1 @@
3.3.1

1
docs/.ruby-version Normal file
View File

@ -0,0 +1 @@
3.3.1

View File

@ -1,5 +1,7 @@
source "https://rubygems.org" source "https://rubygems.org"
ruby file: ".ruby-version"
gem "github-pages", group: :jekyll_plugins gem "github-pages", group: :jekyll_plugins
group :test do group :test do