Skip to content

Commit b82fdd9

Browse files
committed
Add linter to CI workflow
1 parent d744774 commit b82fdd9

File tree

3 files changed

+54
-18
lines changed

3 files changed

+54
-18
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
1+
---
12
name: CI
23

34
on:
4-
push:
55
pull_request:
6+
push:
67

78
jobs:
8-
test:
9-
runs-on: ubuntu-latest
10-
strategy:
11-
matrix:
12-
ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
9+
lint:
10+
name: Lint
11+
uses: ./.github/workflows/lint.yml
1312

14-
steps:
15-
- uses: actions/checkout@v4
16-
17-
- name: Set up Ruby ${{ matrix.ruby-version }}
18-
uses: ruby/setup-ruby@v1
19-
with:
20-
ruby-version: ${{ matrix.ruby-version }}
21-
bundler-cache: true
22-
23-
- name: Run tests
24-
run: bundle exec rake
25-
continue-on-error: ${{ matrix.continue-on-error || false }}
13+
test:
14+
name: Test
15+
uses: ./.github/workflows/test.yml

.github/workflows/lint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Lint
3+
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
lint-ruby:
9+
name: Ruby
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Ruby
15+
uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: 3.4
18+
bundler-cache: true
19+
20+
- name: Run RuboCop linter
21+
run: bundle exec rubocop

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Test
3+
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
test:
9+
name: RSpec
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Ruby ${{ matrix.ruby-version }}
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: ${{ matrix.ruby-version }}
22+
bundler-cache: true
23+
24+
- name: Run RSpec specs
25+
run: bundle exec rspec

0 commit comments

Comments
 (0)