Set up your GitHub Actions workflow with a specific version of Ruby
Please note: This action is deprecated and should no longer be used. The team at GitHub has ceased making and accepting code contributions or maintaining issues tracker. Please, migrate your workflows to the ruby/setup-ruby, which is being actively maintained by the official Ruby organization.
This action sets up a ruby environment for versions which are installed on the Actions Virtual Environments.
Virtual environments contain only one Ruby version within a 'major.minor' release, and are updated with new releases. Hence, a workflow should only be bound to minor versions.
Note that a
ruby-version:of
2.6or
2.6.xare equivalent.
Supports
2.4,2.5,2.6, and2.7.
See action.yml
Basic:
yaml steps: - uses: actions/[email protected] - uses: actions/[email protected] with: ruby-version: '2.6' # Version range or exact version of a Ruby version to use, using semvers version range syntax. - run: ruby hello.rb
Matrix Testing:
yaml jobs: build: runs-on: ubuntu-16.04 strategy: matrix: ruby: [ '2.5', '2.6' ] name: Ruby ${{ matrix.ruby }} sample steps: - uses: actions/[email protected] - uses: actions/[email protected] with: ruby-version: ${{ matrix.ruby }} - run: ruby hello.rb
Ruby on Rails Testing: ```yaml name: Rails Unit Tests
on: [push, pull_request]
jobs: build:
runs-on: ubuntu-latestservices: db: image: postgres:11 ports: ['5432:5432'] options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
Caching Dependencies
See actions/cache and the Ruby Gem cache example.
License
The scripts and documentation in this project are released under the MIT License
Contributions
Contributions are welcome! See Contributor's Guide
Code of Conduct
:wave: Be nice. See our code of conduct