Skip to content

CI

CI #4794

Workflow file for this run

name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
branches: [ master ]
schedule:
- cron: '0 1 * * *'
jobs:
lostconf:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run lostconf
run: npx lostconf
v2_5-non-rails-rubocop:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1
with:
ruby-version: '4.0.1'
- name: Bundle install
working-directory: v2.5-non-rails
env:
BUNDLE_GEMFILE: Gemfile.lint
run: bundle install --jobs 4 --retry 3
- name: Run rubocop
working-directory: v2.5-non-rails
env:
BUNDLE_GEMFILE: Gemfile.lint
run: bundle exec rubocop
v2_4-non-rails-specs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- '4.0'
- '3.4'
- '3.3'
- '3.2'
include:
- ruby: '4.0'
coverage: 'true'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install package dependencies
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
- name: Set up Ruby
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1
with:
ruby-version: ${{matrix.ruby}}
bundler: 'latest'
- name: Install latest bundler
run: |
cd v2.4-non-rails
gem install bundler --no-document
bundle config set without 'tools benchmarks docs'
- name: Bundle install
run: |
cd v2.4-non-rails
# For Ruby 4.0, use local gem path to avoid permission issues with default gems
if [ "${{ matrix.ruby }}" = "4.0" ]; then
bundle config set path vendor/bundle
fi
bundle config set without development
bundle install --jobs 4 --retry 3
- name: Run all tests
env:
GITHUB_COVERAGE: ${{matrix.coverage}}
run: |
cd v2.4-non-rails
bundle exec rspec
v2_5-rails-rubocop:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1
with:
ruby-version: '4.0.1'
- name: Bundle install
working-directory: v2.5-rails
env:
BUNDLE_GEMFILE: Gemfile.lint
run: bundle install --jobs 4 --retry 3
- name: Run rubocop
working-directory: v2.5-rails
env:
BUNDLE_GEMFILE: Gemfile.lint
run: bundle exec rubocop
v2_4-rails-specs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- '4.0'
- '3.4'
- '3.3'
- '3.2'
include:
- ruby: '4.0'
coverage: 'true'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install package dependencies
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
- name: Set up Ruby
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1
with:
ruby-version: ${{matrix.ruby}}
bundler: 'latest'
- name: Install latest bundler
run: |
cd v2.4-rails
gem install bundler --no-document
bundle config set without 'tools benchmarks docs'
- name: Bundle install
run: |
cd v2.4-rails
# For Ruby 4.0, use local gem path to avoid permission issues with default gems
if [ "${{ matrix.ruby }}" = "4.0" ]; then
bundle config set path vendor/bundle
fi
bundle config set without development
bundle install --jobs 4 --retry 3
- name: Setup db
run: |
cd v2.4-rails
bundle exec rake db:create
bundle exec rake db:test:prepare
- name: Run all tests
env:
GITHUB_COVERAGE: ${{matrix.coverage}}
run: |
cd v2.4-rails
bundle exec rspec
ci-success:
name: CI Success
runs-on: ubuntu-latest
if: always()
needs:
- lostconf
- v2_5-non-rails-rubocop
- v2_5-rails-rubocop
- v2_4-non-rails-specs
- v2_4-rails-specs
steps:
- name: Check all jobs passed
if: |
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled') ||
contains(needs.*.result, 'skipped')
run: exit 1
- run: echo "All CI checks passed!"