Skip to content

Move CI builds using experimental Rubies to a different workflow #52

Move CI builds using experimental Rubies to a different workflow

Move CI builds using experimental Rubies to a different workflow #52

name: Continuous Integration
# This is a workflow fix
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3", "jruby-head", "truffleruby-head"]
operating-system: [ubuntu-latest]
include:
- # Run minimal Ruby version supported on windows-latest
ruby: 3.0
operating-system: windows-latest
- # Run maximal Ruby version supported on windows-latest
ruby: 3.3
operating-system: windows-latest
env:
JAVA_OPTS: -Djdk.io.File.enableADS=true
JRUBY_OPTS: --debug
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run rake
run: bundle exec rake
experimental:
name: Experimental builds
needs: [build]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' # Only run if on main branch
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install GitHub CLI
run: sudo apt-get install gh -y
- name: Authenticate with GitHub CLI
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Trigger Experimental Workflow
run: gh workflow run experimental_continuous_integration.yml
coverage:
name: Report test coverage to CodeClimate
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Run tests
run: bundle exec rake spec
- name: Report test coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: d3bf532dce7cc5d9ae5ae10efd7708d8465d3cc6236e5e11377cbef62ed2b32f
with:
coverageLocations: ${{github.workspace}}/coverage/lcov/*.lcov:lcov