Skip to content

Add Gemfile.lock for different Ruby versions #434

Add Gemfile.lock for different Ruby versions

Add Gemfile.lock for different Ruby versions #434

Workflow file for this run

name: Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- spec_live
jobs:
test-and-lint:
name: Test and lint
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "jruby-9.4"
steps:
- name: Checkout code
uses: zendesk/checkout@v2
- name: Set up Ruby
uses: zendesk/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
- name: Custom cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}-${{ matrix.ruby }}
restore-keys: |
${{ runner.os }}-gems-${{ matrix.ruby }}
- name: Install gems
run: |
BUNDLE_GEMFILE=Gemfile.${{ matrix.ruby }} bundle install --jobs 4 --retry 3 --path vendor/bundle
- name: Test
run: |
BUNDLE_GEMFILE=Gemfile.${{ matrix.ruby }} bundle exec rake
- name: Lint
if: matrix.ruby == '2.7'
run: |
BUNDLE_GEMFILE=Gemfile.2.7 bundle exec rubocop
spec-live:
name: Spec live
if: github.repository == 'zendesk/zendesk_api_client_rb'
env:
SPEC_LIVE_USERNAME: ${{ secrets.SPEC_LIVE_USERNAME }}
SPEC_LIVE_PASSWORD: ${{ secrets.SPEC_LIVE_PASSWORD }}
SPEC_LIVE_ZENDESK_HOST: ${{ secrets.SPEC_LIVE_ZENDESK_HOST }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: zendesk/checkout@v2
- name: Set up Ruby
uses: zendesk/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.1
- name: spec:live
run: |
BUNDLE_GEMFILE=Gemfile.3.1 bundle install --jobs 4 --retry 3 --path vendor/bundle
BUNDLE_GEMFILE=Gemfile.3.1 bundle exec rake clean_live set_ci_credentials spec:live ||
BUNDLE_GEMFILE=Gemfile.3.1 bundle exec rake clean_live &&
BUNDLE_GEMFILE=Gemfile.3.1 bundle exec rspec spec/live --only-failures