Skip to content

Commit 00d1e6d

Browse files
authored
Merge pull request #8 from rubyatscale/jms/test_command_input
make test command overridable in shared CI workflow
2 parents 03ed5b9 + b3eec79 commit 00d1e6d

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ name: CI
22

33
on:
44
workflow_call:
5+
inputs:
6+
test-command:
7+
description: 'The command to run tests'
8+
required: false
9+
type: string
10+
default: 'bundle exec rspec'
511
jobs:
6-
rspec:
12+
run_tests:
713
runs-on: ubuntu-latest
814
strategy:
915
matrix:
@@ -13,7 +19,7 @@ jobs:
1319
- 3.3
1420
env:
1521
BUNDLE_GEMFILE: Gemfile
16-
name: "RSpec tests: Ruby ${{ matrix.ruby }}"
22+
name: "Run tests: Ruby ${{ matrix.ruby }}"
1723
steps:
1824
- uses: actions/checkout@v4
1925
- name: Install ripgrep
@@ -24,7 +30,7 @@ jobs:
2430
bundler-cache: true
2531
ruby-version: ${{ matrix.ruby }}
2632
- name: Run tests
27-
run: bundle exec rspec
33+
run: ${{ inputs.test-command }}
2834
static_type_check:
2935
name: "Type Check"
3036
runs-on: ubuntu-latest
@@ -51,7 +57,7 @@ jobs:
5157
run: bundle exec rubocop
5258
notify_on_failure:
5359
runs-on: ubuntu-latest
54-
needs: [rspec, static_type_check, rubocop]
60+
needs: [run_tests, static_type_check, rubocop]
5561
if: ${{ failure() && github.ref == 'refs/heads/main' }}
5662
env:
5763
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 commit comments

Comments
 (0)