Skip to content

Commit fe431bf

Browse files
authored
Merge pull request #64 from rubocop/ci-setup
Optimize CI setup
2 parents c8b417a + 3f0a4b6 commit fe431bf

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

.github/workflows/actions.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: CI
2-
on: [push, pull_request]
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
39
jobs:
410
main:
511
name: Ruby ${{ matrix.ruby }}
@@ -18,10 +24,24 @@ jobs:
1824
- uses: actions/checkout@v6
1925
- uses: ruby/setup-ruby@v1
2026
with:
21-
ruby-version: ${{ matrix.ruby }}
22-
- name: Install gems
23-
run: bundle install
27+
ruby-version: "${{ matrix.ruby }}"
28+
bundler-cache: true
2429
- name: RuboCop
2530
run: bundle exec rubocop --parallel
2631
- name: RSpec
2732
run: bundle exec rspec
33+
34+
success:
35+
name: Checks passing?
36+
needs: main
37+
if: always()
38+
runs-on: ubuntu-latest
39+
steps:
40+
- run: |
41+
if ${{ needs.main.result == 'success' }}
42+
then
43+
echo "All checks passed"
44+
else
45+
echo "Some checks failed"
46+
false
47+
fi

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ source 'https://rubygems.org'
44

55
gemspec
66

7-
gem 'rake', '~> 13.3.1'
87
gem 'rspec', '~> 3.7'
98
gem 'rubocop', '~> 1.76.0'
109
gem 'rubocop-rspec', '~> 3.5.0'

0 commit comments

Comments
 (0)