Skip to content

Commit f952ba3

Browse files
martinemdeivy
andauthored
Update bundler, update rubocop, get CI passing again (#55)
* bundle update --bundler * bundle lock --normalize-platforms * bundle binstubs sorbet * bundle binstubs rspec-core * Rubocop exclude binstubs * Clean up development dependencies Also adds rubocop-performance which is getting loaded in CI somehow. * Update rubocop and run rubocop -A Also include rspec rubocop fixes, but I removed the rubocop-rspec gem to avoid having to do a lot of manual fixes. * Remove rubocop.yml inherit_gem directive. When blank it does weird things * Exclude vendor so we don't pick up gems and try to rubocop them * Add the ruby platform back to the bundle * Pull in shared_config to see if we can get it working --------- Co-authored-by: Ivy Evans <[email protected]>
1 parent 5e66636 commit f952ba3

15 files changed

+362
-180
lines changed

Diff for: .github/workflows/ci.yml

+58-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,61 @@ on:
77
pull_request:
88

99
jobs:
10-
call-workflow-from-shared-config:
11-
uses: rubyatscale/shared-config/.github/workflows/ci.yml@main
12-
secrets: inherit
10+
run_tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
ruby:
15+
- 3.2
16+
- 3.3
17+
- 3.4
18+
env:
19+
BUNDLE_GEMFILE: Gemfile
20+
name: "Run tests: Ruby ${{ matrix.ruby }}"
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Ruby ${{ matrix.ruby }}
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
bundler-cache: true
27+
ruby-version: ${{ matrix.ruby }}
28+
- name: Run tests
29+
run: bundle exec rspec
30+
static_type_check:
31+
name: "Type Check"
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Set up Ruby
36+
uses: ruby/setup-ruby@v1
37+
with:
38+
bundler-cache: true
39+
ruby-version: 3.3
40+
- name: Run static type checks
41+
run: bundle exec srb tc
42+
run_linter:
43+
runs-on: ubuntu-latest
44+
name: "Linter"
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Set up Ruby
48+
uses: ruby/setup-ruby@v1
49+
with:
50+
bundler-cache: true
51+
ruby-version: 3.3
52+
- name: Run linter
53+
run: bundle exec rubocop
54+
notify_on_failure:
55+
runs-on: ubuntu-latest
56+
needs: [run_tests, static_type_check, run_linter]
57+
if: ${{ failure() && github.ref == 'refs/heads/main' }}
58+
env:
59+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
60+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
61+
steps:
62+
- uses: slackapi/[email protected]
63+
with:
64+
payload: |
65+
{
66+
"text": "${{ github.repository }}/${{ github.ref }}: FAILED\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
67+
}

Diff for: .rubocop.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
inherit_gem:
2-
require:
1+
plugins:
32
- rubocop-sorbet
3+
- rubocop-performance
44

55
AllCops:
66
TargetRubyVersion: 2.6
77
NewCops: enable
8+
Exclude:
9+
- bin/**/*
10+
- vendor/**/*
811

912
Sorbet/StrictSigil:
1013
Enabled: true

Diff for: Gemfile

+11
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,16 @@ source 'https://rubygems.org'
55
# Specify your gem's dependencies in danger-packwerk.gemspec
66
gemspec
77

8+
# Override the version of packwerk that is installed by the gemspec
89
gem 'packwerk', github: 'Shopify/packwerk', branch: 'main'
10+
11+
# Development dependencies
12+
gem 'pry'
913
gem 'railties'
14+
gem 'rake'
15+
gem 'rspec', '~> 3.0'
16+
gem 'rubocop'
17+
gem 'rubocop-performance'
18+
gem 'rubocop-sorbet'
19+
gem 'sorbet'
20+
gem 'tapioca'

0 commit comments

Comments
 (0)