Skip to content

Commit

Permalink
Merge pull request #4 from thanx/rebase-upstream
Browse files Browse the repository at this point in the history
Rebase upstream
  • Loading branch information
blb451 authored Sep 4, 2024
2 parents de3d177 + dc5137f commit 38207ed
Show file tree
Hide file tree
Showing 134 changed files with 2,688 additions and 593 deletions.
25 changes: 0 additions & 25 deletions .github/stale.yml

This file was deleted.

104 changes: 104 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: RPush Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
POSTGRES_USER: postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_DB: rpush_test
PGPASSWORD: postgres # https://www.postgresql.org/docs/13/libpq-envars.html

jobs:
test:
runs-on: ubuntu-20.04

services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379

strategy:
fail-fast: false
matrix:
gemfile: ['rails_6.0', 'rails_6.1', 'rails_7.0']

ruby: ['2.7', '3.0', '3.1']

client: ['active_record', 'redis']

exclude:
- ruby: '2.7'
gemfile: 'rails_7.0'

env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile

steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Create PostgreSQL database
run: |
createdb \
--host=$POSTGRES_HOST \
--port=$POSTGRES_PORT \
--username=$POSTGRES_USER \
$POSTGRES_DB
- name: Run tests
run: bundle exec rake
env:
# The hostname used to communicate with the PostgreSQL service container
POSTGRES_HOST: localhost
# The default PostgreSQL port
POSTGRES_PORT: 5432
CLIENT: ${{ matrix.client }}

tests:
runs-on: ubuntu-latest
needs: test
if: always()
steps:
- name: All tests ok
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Some tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ require: rubocop-performance

AllCops:
Exclude:
- gemfiles/vendor/bundle/**/* # This dir only shows up on Travis
- lib/generators/**/*
- vendor/bundle/**/*
TargetRubyVersion: 2.3
NewCops: enable
TargetRubyVersion: 2.4

Layout/LineLength:
Enabled: false
Expand Down
Loading

0 comments on commit 38207ed

Please sign in to comment.