Skip to content

Commit 1927183

Browse files
committed
ci
1 parent 6d18fb2 commit 1927183

1 file changed

Lines changed: 59 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,94 @@
1-
name: Test
1+
name: CI
22

33
on:
44
push:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
workflow_dispatch:
89

910
jobs:
11+
lint:
12+
name: Lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Setup Ruby
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: "3.4"
21+
bundler-cache: true
22+
23+
- name: Install dependencies
24+
run: |
25+
# Make sure bundler is using the correct Ruby version
26+
ruby -v
27+
bundle install
28+
npm install prettier
29+
30+
- name: Rubocop
31+
run: bin/rubocop
32+
33+
- name: Sorbet Typecheck
34+
run: bin/typecheck
35+
36+
- name: Spellcheck
37+
run: bin/spellcheck
38+
39+
- name: Prettier (Format Check)
40+
run: npx prettier --check "**/*.{js,json,md}"
41+
1042
test:
43+
name: "Tests: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}"
44+
needs: [lint]
1145
runs-on: ubuntu-latest
1246
strategy:
1347
fail-fast: false
1448
matrix:
15-
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4"]
49+
ruby: ["2.7", "3.0", "3.2", "3.4"]
1650
rails: ["7.0", "7.1", "8.0"]
1751
exclude:
52+
# Rails 8.0 requires Ruby 3.1+
53+
- ruby: "2.7"
54+
rails: "8.0"
1855
- ruby: "3.0"
1956
rails: "8.0"
2057

2158
env:
2259
RAILS_VERSION: ${{ matrix.rails }}
60+
RUBY_VERSION: ${{ matrix.ruby }}
2361

2462
steps:
2563
- uses: actions/checkout@v3
2664

27-
- name: Set up Ruby
65+
- name: Setup Ruby ${{ matrix.ruby }}
2866
uses: ruby/setup-ruby@v1
2967
with:
3068
ruby-version: ${{ matrix.ruby }}
3169
bundler-cache: true
3270

71+
# Create a .ruby-version file with the matrix Ruby version
72+
- name: Set Ruby version
73+
run: echo "${{ matrix.ruby }}" > .ruby-version
74+
3375
- name: Install dependencies
3476
run: |
77+
# Make sure bundler is using the correct Ruby version
78+
ruby -v
79+
# Configure bundler
3580
bundle config set --local without 'development'
81+
# Install dependencies with the specific Rails version
3682
bundle install
3783
3884
- name: Run tests
39-
run: bundle exec rake test
85+
run: bin/test
86+
87+
# Optional: Save coverage data as an artifact
88+
- name: Upload coverage reports
89+
uses: actions/upload-artifact@v3
90+
if: success()
91+
with:
92+
name: coverage-ruby${{ matrix.ruby }}-rails${{ matrix.rails }}
93+
path: coverage/
94+
retention-days: 5

0 commit comments

Comments
 (0)