File tree Expand file tree Collapse file tree 3 files changed +36
-15
lines changed Expand file tree Collapse file tree 3 files changed +36
-15
lines changed Original file line number Diff line number Diff line change @@ -3,19 +3,22 @@ name: RSpec Shared
3
3
on :
4
4
workflow_call :
5
5
inputs :
6
- os-version :
6
+ os_version :
7
7
required : true
8
8
type : string
9
- ruby-version :
9
+ ruby_version :
10
10
required : true
11
11
type : string
12
- test-tag :
13
- required : true
12
+ test_tag :
13
+ required : false
14
+ type : string
15
+ spec_paths :
16
+ required : false
14
17
type : string
15
18
16
19
jobs :
17
20
rspec :
18
- runs-on : ${{ inputs.os-version }}
21
+ runs-on : ${{ inputs.os_version }}
19
22
env :
20
23
RAILS_ENV : test
21
24
# We have to add "_CI" to the end, otherwise it messes with tests where we switch profiles,
28
31
- name : Set up Ruby
29
32
uses : ruby/setup-ruby@v1
30
33
with :
31
- ruby-version : ${{ inputs.ruby-version }}
34
+ ruby-version : ${{ inputs.ruby_version }}
32
35
bundler-cache : true
33
36
- name : Install dependencies
34
37
run : bundle install
@@ -41,16 +44,16 @@ jobs:
41
44
cpln profile create default --token $CPLN_TOKEN_CI --org $CPLN_ORG
42
45
cpln image docker-login
43
46
- name : Run tests
44
- run : bundle exec rspec --format documentation --tag ${{ inputs.test-tag }}
47
+ run : bundle exec rspec --format documentation ${{ inputs.test_tag && format(' --tag {0}', inputs.test_tag) }} ${{ inputs.spec_paths }}
45
48
- name : Upload spec log
46
49
uses : actions/upload-artifact@master
47
50
if : always()
48
51
with :
49
- name : spec-${{ inputs.test-tag }}-${{ github.run_id }}-${{ inputs.os-version }}-${{ inputs.ruby-version }}.log
52
+ name : spec-${{ inputs.test_tag }}-${{ github.run_id }}-${{ inputs.os_version }}-${{ inputs.ruby_version }}.log
50
53
path : spec.log
51
54
- name : Upload coverage results
52
55
uses : actions/upload-artifact@master
53
56
if : always()
54
57
with :
55
- name : coverage-report-${{ inputs.test-tag }}-${{ github.run_id }}-${{ inputs.os-version }}-${{ inputs.ruby-version }}
58
+ name : coverage-report-${{ inputs.test_tag }}-${{ github.run_id }}-${{ inputs.os_version }}-${{ inputs.ruby_version }}
56
59
path : coverage
Original file line number Diff line number Diff line change
1
+ name : RSpec Specific
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ spec_paths :
7
+ description : " Test files or directories that should be run"
8
+ required : true
9
+
10
+ jobs :
11
+ rspec-specific :
12
+ name : RSpec (Specific)
13
+ uses : ./.github/workflows/rspec-shared.yml
14
+ with :
15
+ os_version : ubuntu-latest
16
+ ruby_version : " 3.2"
17
+ spec_paths : ${{ inputs.spec_paths }}
18
+ secrets : inherit
Original file line number Diff line number Diff line change @@ -12,17 +12,17 @@ jobs:
12
12
name : RSpec (Fast)
13
13
uses : ./.github/workflows/rspec-shared.yml
14
14
with :
15
- os-version : ubuntu-latest
16
- ruby-version : " 3.2"
17
- test-tag : ~slow
15
+ os_version : ubuntu-latest
16
+ ruby_version : " 3.2"
17
+ test_tag : ~slow
18
18
secrets : inherit
19
19
20
20
rspec-slow :
21
21
name : RSpec (Slow)
22
22
uses : ./.github/workflows/rspec-shared.yml
23
23
if : github.event_name == 'workflow_dispatch'
24
24
with :
25
- os-version : ubuntu-latest
26
- ruby-version : " 3.2"
27
- test-tag : slow
25
+ os_version : ubuntu-latest
26
+ ruby_version : " 3.2"
27
+ test_tag : slow
28
28
secrets : inherit
You can’t perform that action at this time.
0 commit comments