8000 Split ci workflows by maxkadel · Pull Request #3578 · projectblacklight/blacklight · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Split ci workflows #3578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/matrix.json
10000
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"ruby": [
"3.3"
],
"rails_version": [
"7.1.5.1",
"7.2.2.1"
],
"bootstrap_version": [
null
],
"view_component_version": [
"~> 3.12"
],
"api": [
null
],
"additional_engine_cart_rails_options": [
""
],
"additional_name": [
""
],
"include": [
{
"ruby": "3.3",
"rails_version": "8.0.1",
"additional_engine_cart_rails_options": "--css=bootstrap"
},
{
"ruby": "3.3",
"rails_version": "8.0.1",
"additional_engine_cart_rails_options": "--css=bootstrap --js=esbuild",
"additional_name": "| esbuild"
},
{
"ruby": "3.2",
"rails_version": "7.1.5.1",
"solr_version": "8.11.2",
"additional_name": "Solr 8.11.2"
},
{
"ruby": "3.1",
"rails_version": "7.1.5.1"
},
{
"ruby": "3.1",
"rails_version": "7.1.5.1",
"view_component_version": "~> 2.74",
"additional_name": "| ViewComponent 2"
},
{
"ruby": "3.1",
"rails_version": "7.1.5.1",
"additional_name": "| Propshaft",
"additional_engine_cart_rails_options": "-a propshaft --css=bootstrap"
},
{
"ruby": "3.1",
"rails_version": "7.1.5.1",
"bootstrap_version": "~> 4.0",
"additional_name": "| Bootstrap 4"
},
{
"ruby": "3.3",
"rails_version": "7.1.5.1",
"api": "true",
"additional_engine_cart_rails_options": "--api --skip-yarn",
"additional_name": "| API"
},
{
"ruby": "3.3",
"rails_version": "7.2.2.1",
"additional_engine_cart_rails_options": "-a propshaft --css=bootstrap --js=esbuild",
"additional_name": "| Propshaft, esbuild"
}
]
}
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on:
workflow_call:
inputs:
ref:
required: false
type: string
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Build docker image
run: docker compose build app
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
workflow_call:
inputs:
ref:
required: false
type: string
default: ''
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler: "latest"
- name: Change permissions
run: "chmod -f -R o-w /opt/hostedtoolcache/Ruby/3.2.5/x64/lib/ruby/gems/3.2.0/gems | :"
- name: Install dependencies
run: bundle install
- name: Run linter
run: bundle exec rake rubocop
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: CI

on:
push:
branches:
- main
- "release-*"
pull_request:
jobs:
lint:
uses: ./.github/workflows/lint.yml
test:
uses: ./.github/workflows/test.yml
with:
ruby: '["3.3"]'
docker_build:
uses: ./.github/workflows/build.yml
106 changes: 0 additions & 106 deletions .github/workflows/ruby.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on:
workflow_call:
inputs:
ref:
required: false
type: string
default: ''
description: The branch or reference to run the workflow against
ruby:
required: false
type: string
default: ''
description: Deprecated - use matrix.json instead
jobs:
set_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Echo ./.github/matrix.json
id: matrix
run: |
echo "matrix<<EOF" >> $GITHUB_OUTPUT
cat ./.github/matrix.json >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
test:
needs: set_matrix
runs-on: ubuntu-latest
name: ruby ${{ matrix.ruby }} | rails ${{ matrix.rails_version }} ${{ matrix.additional_name }}
strategy:
fail-fast: false
matrix: ${{fromJson(needs.set_matrix.outputs.matrix)}}
env:
RAILS_VERSION: ${{ matrix.rails_version }}
SOLR_VERSION: ${{ matrix.solr_version || 'latest' }}
VIEW_COMPONENT_VERSION: ${{ matrix.view_component_version }}
BOOTSTRAP_VERSION: ${{ matrix.bootstrap_version }}
BLACKLIGHT_API_TEST: ${{ matrix.api }}
ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-kamal --skip-solid --skip-coffee --skip-test ${{ matrix.additional_engine_cart_rails_options }}"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler: "latest"
ruby-version: ${{ matrix.ruby }}
- name: Change permissions
run: "chmod -f -R o-w /opt/hostedtoolcache/Ruby/3.2.5/x64/lib/ruby/gems/3.2.0/gems | :"
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake ci
0