Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move CI to Github Actions, update Rubocop, fix Jruby tests #251

Merged
merged 5 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 0 additions & 62 deletions .circleci/config.yml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Ruby
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published]

jobs:
test:
name: rails / rspec
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby_version:
- 3.0
- 3.1
- 3.2
- 3.3
- jruby
rails_version:
- 6_1
- 7_0
- 7_1
# - master # versions failing
exclude:
- ruby_version: jruby
rails_version: 7_1
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}.gemfile
CI: true
services:
postgres:
image: postgres:14 # pg_dump tests currently depend on this version
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: apartment_postgresql_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: apartment_mysql_test
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Configure config database.yml
run: bundle exec rake db:copy_credentials
- name: Database Setup
run: bundle exec rake db:test:prepare
- name: Run tests
run: bundle exec rspec --format progress --format RspecJunitFormatter -o ~/test-results/rspec/rspec.xml
22 changes: 0 additions & 22 deletions .github/workflows/reviewdog.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Ruby
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published]

jobs:
rubocop:
name: runner / rubocop
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_7_0.gemfile
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Rubocop
run: "bundle exec rubocop"
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require:

AllCops:
Exclude:
- vendor/bundle/**/*
- gemfiles/**/*.gemfile
- gemfiles/vendor/**/*
- spec/dummy_engine/dummy_engine.gemspec
Expand All @@ -30,3 +31,6 @@ Rails/ApplicationRecord:

Rails/Output:
Enabled: false

Style/Documentation:
Enabled: false
Loading
Loading