Skip to content

Commit 0f4c823

Browse files
authored
Merge pull request #251 from mrpasquini/github_actions
Move CI to Github Actions, update Rubocop, fix Jruby tests
2 parents 1de1f1b + e5bc396 commit 0f4c823

12 files changed

+366
-146
lines changed

.circleci/config.yml

-62
This file was deleted.

.github/workflows/main.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Ruby
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
test:
13+
name: rails / rspec
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
ruby_version:
19+
- 3.0
20+
- 3.1
21+
- 3.2
22+
- 3.3
23+
- jruby
24+
rails_version:
25+
- 6_1
26+
- 7_0
27+
- 7_1
28+
# - master # versions failing
29+
exclude:
30+
- ruby_version: jruby
31+
rails_version: 7_1
32+
env:
33+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}.gemfile
34+
CI: true
35+
services:
36+
postgres:
37+
image: postgres:14 # pg_dump tests currently depend on this version
38+
env:
39+
POSTGRES_PASSWORD: postgres
40+
POSTGRES_HOST_AUTH_METHOD: trust
41+
POSTGRES_DB: apartment_postgresql_test
42+
options: >-
43+
--health-cmd pg_isready
44+
--health-interval 10s
45+
--health-timeout 5s
46+
--health-retries 5
47+
ports:
48+
- 5432:5432
49+
mysql:
50+
image: mysql:8.0
51+
env:
52+
MYSQL_ALLOW_EMPTY_PASSWORD: true
53+
MYSQL_DATABASE: apartment_mysql_test
54+
options: >-
55+
--health-cmd "mysqladmin ping"
56+
--health-interval 10s
57+
--health-timeout 5s
58+
--health-retries 5
59+
ports:
60+
- 3306:3306
61+
steps:
62+
- uses: actions/checkout@v4
63+
- name: Set up Ruby ${{ matrix.ruby-version }}
64+
uses: ruby/setup-ruby@v1
65+
with:
66+
ruby-version: ${{ matrix.ruby_version }}
67+
bundler-cache: true
68+
- name: Configure config database.yml
69+
run: bundle exec rake db:copy_credentials
70+
- name: Database Setup
71+
run: bundle exec rake db:test:prepare
72+
- name: Run tests
73+
run: bundle exec rspec --format progress --format RspecJunitFormatter -o ~/test-results/rspec/rspec.xml

.github/workflows/reviewdog.yml

-22
This file was deleted.

.github/workflows/rubocop.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Ruby
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
rubocop:
13+
name: runner / rubocop
14+
runs-on: ubuntu-latest
15+
env:
16+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_7_0.gemfile
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: ruby/setup-ruby@v1
20+
with:
21+
bundler-cache: true
22+
- name: Rubocop
23+
run: "bundle exec rubocop"

.rubocop.yml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require:
77

88
AllCops:
99
Exclude:
10+
- vendor/bundle/**/*
1011
- gemfiles/**/*.gemfile
1112
- gemfiles/vendor/**/*
1213
- spec/dummy_engine/dummy_engine.gemspec
@@ -30,3 +31,6 @@ Rails/ApplicationRecord:
3031

3132
Rails/Output:
3233
Enabled: false
34+
35+
Style/Documentation:
36+
Enabled: false

0 commit comments

Comments
 (0)