Skip to content

Commit 73bf99d

Browse files
ci: reorganize jobs, names, etc (#38)
Signed-off-by: Josh Nichols <[email protected]>
1 parent 61720e6 commit 73bf99d

File tree

1 file changed

+33
-15
lines changed

1 file changed

+33
-15
lines changed

.github/workflows/main.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
1-
name: Ruby
1+
name: CI
22

3-
on:
4-
push:
5-
branches: [main]
6-
pull_request:
7-
branches: [main]
3+
on: push
84

95
jobs:
10-
build:
6+
rspec:
117
runs-on: ${{ matrix.os }}
12-
name: Ruby ${{ matrix.ruby }}
8+
name: Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
139
strategy:
1410
fail-fast: false
1511
matrix:
1612
os: [ubuntu-latest, macos-latest, windows-latest]
1713
ruby:
18-
- "3.1.2"
19-
- "2.7.6"
20-
- "3.0.4"
14+
- "2.7"
15+
- "3.0"
16+
- "3.1"
2117
env:
2218
BUNDLE_GEMFILE: Gemfile
2319

@@ -27,8 +23,30 @@ jobs:
2723
with:
2824
ruby-version: ${{ matrix.ruby }}
2925
- run: bundle install
30-
- run: bundle exec rake
31-
- name: Run style checks
32-
run: bundle exec rubocop
33-
- name: Run tests
26+
- name: RSpec
3427
run: bundle exec rspec
28+
rubocop:
29+
name: Rubocop
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: 3.1
36+
- run: bundle install
37+
- name: Rubocop
38+
run: bundle exec rubocop --color
39+
# check the status of other jobs, so we can have a single job dependency for branch protection
40+
# https://github.com/community/community/discussions/4324#discussioncomment-3477871
41+
status:
42+
name: CI Status
43+
runs-on: ubuntu-latest
44+
needs: [rspec, rubocop]
45+
if: always()
46+
steps:
47+
- name: Successful CI
48+
if: ${{ !(contains(needs.*.result, 'failure')) }}
49+
run: exit 0
50+
- name: Failing CI
51+
if: ${{ contains(needs.*.result, 'failure') }}
52+
run: exit 1

0 commit comments

Comments
 (0)