Set up your GitHub Actions workflow with a specific version of Ruby
Go to file
Alena Sviridenko e932e7af67
Deprecation of action
Deprecation of actions/setup-ruby
2021-02-09 14:42:02 +03:00
__tests__ run lint 2020-09-29 18:53:21 -04:00
.github/workflows updated wording, fixed matrix 2021-02-04 14:19:48 +03:00
.licenses/npm update licensed 2020-09-23 12:50:37 -04:00
dist updated wording, fixed matrix 2021-02-04 14:19:48 +03:00
docs update contributors guide 2020-01-12 10:08:22 -05:00
src updated wording, fixed matrix 2021-02-04 14:19:48 +03:00
.gitattributes Add Licensed to verify third party dependencies 2020-09-09 15:01:38 -04:00
.gitignore reverted gitignore updates 2021-02-03 14:45:00 +03:00
.licensed.yml Add Licensed to verify third party dependencies 2020-09-09 15:01:38 -04:00
.prettierrc.json Init repo from template 2019-06-26 14:22:50 -04:00
action.yml update tool-cache for proxy and fix tests (#57) 2020-01-31 13:57:22 -05:00
CONDUCT code of conduct 2020-01-23 22:24:47 -05:00
jest.config.js Init repo from template 2019-06-26 14:22:50 -04:00
LICENSE Init repo from template 2019-06-26 14:22:50 -04:00
package-lock.json update @actions/core to the latest version 2020-09-23 12:40:15 -04:00
package.json update tool-cache for proxy and fix tests (#57) 2020-01-31 13:57:22 -05:00
README.md updated wording, fixed matrix 2021-02-04 14:19:48 +03:00
tsconfig.json Init repo from template 2019-06-26 14:22:50 -04:00

setup-ruby

test status

versions status

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.6 or 2.6.x are equivalent.

Supports 2.4, 2.5, 2.6, and 2.7.

Usage

See action.yml

Basic:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
  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:

jobs:
  build:
    runs-on: ubuntu-16.04
    strategy:
      matrix:
        ruby: [ '2.5', '2.6' ]
    name: Ruby ${{ matrix.ruby }} sample
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
      - run: ruby hello.rb

Ruby on Rails Testing:

name: Rails Unit Tests

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    services:
      db:
        image: postgres:11
        ports: ['5432:5432']
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5          

    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby 2.6
      uses: actions/setup-ruby@v1
      with:
        ruby-version: 2.6
    - name: Build and test with Rake
      env:
        PGHOST: 127.0.0.1
        PGUSER: postgres
        RAILS_ENV: test
      run: |
        sudo apt-get -yqq install libpq-dev
        gem install bundler
        bundle install --jobs 4 --retry 3
        bundle exec rails db:create
        bundle exec rails db:migrate
        bundle exec rails test        

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

👋 Be nice. See our code of conduct