Skip to content

Add supplemental dummy install smoke coverage (#1186) #4162

Add supplemental dummy install smoke coverage (#1186)

Add supplemental dummy install smoke coverage (#1186) #4162

Workflow file for this run

name: Ruby based checks
on:
push:
branches:
- "main"
pull_request:
paths:
- "**.rb"
- "**.rbs"
- "**.gemspec"
- "Gemfile"
- "Rakefile"
- "gemfiles/**"
- ".rubocop.yml"
- "package.json"
- "**.ts"
- ".github/workflows/ruby.yml"
workflow_dispatch:
concurrency:
# Pushing new changes to a branch will cancel any in-progress CI runs
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Remove Gemfile.lock
run: rm -f Gemfile.lock
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
rubygems: latest
bundler-cache: true
- name: Ruby rubocop
run: bundle exec rubocop
rbs-validate:
name: RBS Type Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Remove Gemfile.lock
# Remove lock to test compatibility with latest gem versions
run: rm -f Gemfile.lock
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
rubygems: latest
bundler-cache: true
- name: Validate RBS signatures
run: bundle exec rbs validate
setup-matrix:
name: Set up test matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Select matrix (minimal on PRs, full on main / workflow_dispatch)
id: set-matrix
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
# Fast PR feedback: only the newest and oldest supported combos.
# The full matrix below still runs on `main` pushes and via workflow_dispatch.
echo 'matrix={"include":[{"os":"ubuntu-latest","ruby":"3.4","gemfile":"gemfiles/Gemfile-rails.8.0.x"},{"os":"ubuntu-latest","ruby":"2.7","gemfile":"gemfiles/Gemfile-rails.6.0.x"}]}' >> "$GITHUB_OUTPUT"
else
echo 'matrix={"os":["ubuntu-latest"],"ruby":["2.7","3.0","3.1","3.2","3.3","3.4"],"gemfile":["gemfiles/Gemfile-rails.6.0.x","gemfiles/Gemfile-rails.6.1.x","gemfiles/Gemfile-rails.7.0.x","gemfiles/Gemfile-rails.7.1.x","gemfiles/Gemfile-rails.7.2.x","gemfiles/Gemfile-rails.8.0.x"],"exclude":[{"ruby":"2.7","gemfile":"gemfiles/Gemfile-rails.7.2.x"},{"ruby":"2.7","gemfile":"gemfiles/Gemfile-rails.8.0.x"},{"ruby":"3.0","gemfile":"gemfiles/Gemfile-rails.7.2.x"},{"ruby":"3.0","gemfile":"gemfiles/Gemfile-rails.8.0.x"},{"ruby":"3.1","gemfile":"gemfiles/Gemfile-rails.6.0.x"},{"ruby":"3.1","gemfile":"gemfiles/Gemfile-rails.8.0.x"},{"ruby":"3.2","gemfile":"gemfiles/Gemfile-rails.6.0.x"},{"ruby":"3.3","gemfile":"gemfiles/Gemfile-rails.6.0.x"},{"ruby":"3.3","gemfile":"gemfiles/Gemfile-rails.6.1.x"},{"ruby":"3.4","gemfile":"gemfiles/Gemfile-rails.6.0.x"},{"ruby":"3.4","gemfile":"gemfiles/Gemfile-rails.6.1.x"},{"ruby":"3.4","gemfile":"gemfiles/Gemfile-rails.7.0.x"}]}' >> "$GITHUB_OUTPUT"
fi
test:
name: Testing
needs: setup-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
bundler-cache: true
- uses: actions/setup-node@v4
with:
node-version: "20.19.x"
cache: yarn
- name: Install Node dependencies
run: yarn install --frozen-lockfile --production=false
- name: Build TypeScript
run: yarn build
- name: Ruby specs
run: bundle exec rake run_spec:gem