Skip to content

Commit

Permalink
CI: Use reusing workflow for Setup Ruby env
Browse files Browse the repository at this point in the history
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
  • Loading branch information
kostyanf14 committed May 15, 2024
1 parent 728931c commit f916c86
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 50 deletions.
25 changes: 25 additions & 0 deletions .github/actions/setup-ruby/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Setup Ruby environment
description: 'Setup Ruby environment for the repository'

runs:
using: "composite"
steps:
- name: Update Ubuntu package repository
shell: bash
run: sudo apt-get update
- name: Setup sqlite-devel
shell: bash
run: sudo apt-get -y install libsqlite3-dev
- name: Setup libcurl-devel
shell: bash
run: sudo apt-get -y install libcurl4 libcurl3-gnutls libcurl4-openssl-dev

- name: Set up Ruby 3.1.4
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.4
bundler-cache: false

- name: Install dependencies
shell: bash
run: bundle install
56 changes: 6 additions & 50 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Update Ubuntu package repository
run: sudo apt-get update
- name: Setup sqlite-devel
run: sudo apt-get -y install libsqlite3-dev
- name: Setup libcurl-devel
run: sudo apt-get -y install libcurl4 libcurl3-gnutls libcurl4-openssl-dev

- name: Set up Ruby 3.1.4
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.4
bundler-cache: false

- name: Install dependencies
run: bundle install

- name: Setup Ruby
uses: ./.github/actions/setup-ruby
- name: RSpec run
run: bundle exec rspec

Expand All @@ -70,26 +55,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Update Ubuntu package repository
run: sudo apt-get update
- name: Setup sqlite-devel
run: sudo apt-get -y install libsqlite3-dev
- name: Setup libcurl-devel
run: sudo apt-get -y install libcurl4 libcurl3-gnutls libcurl4-openssl-dev

- name: Set up Ruby 3.1.4
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.4
bundler-cache: false

- name: Install dependencies
run: bundle install
- name: Setup Ruby
uses: ./.github/actions/setup-ruby

- name: Check for out-of-date RBIs
run: bundle exec tapioca gems --verify

- name: Run sorbet type check
run: bundle exec srb typecheck

Expand All @@ -101,22 +71,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Update Ubuntu package repository
run: sudo apt-get update
- name: Setup sqlite-devel
run: sudo apt-get -y install libsqlite3-dev
- name: Setup libcurl-devel
run: sudo apt-get -y install libcurl4 libcurl3-gnutls libcurl4-openssl-dev

- name: Set up Ruby 3.1.4
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.4
bundler-cache: false

- name: Install dependencies
run: bundle install
- name: Setup Ruby
uses: ./.github/actions/setup-ruby

- name: RuboCop run
run: |
Expand Down

0 comments on commit f916c86

Please sign in to comment.