Skip to content

Commit

Permalink
Merge pull request #1279 from railsbridge/mx/fix-ci
Browse files Browse the repository at this point in the history
Update CI workflow configuration
  • Loading branch information
ultrasaurus committed Jan 2, 2023
2 parents 93e04e9 + 97ab78d commit b0358a2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,36 @@ jobs:
test:
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: 'development:production'
RAILS_ENV: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
strategy:
fail-fast: false
matrix:
force_postgres: [true, false]
database: [sqlite, postgres]
services:
postgres:
image: postgres
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Force postgres
if: ${{ matrix.force_postgres }}
run: export FORCE_POSTGRES=1
- name: Use postgres?
if: ${{ matrix.database == 'postgres' }}
run: echo "FORCE_POSTGRES=1" >> $GITHUB_ENV
- name: Set up Ruby
uses: ruby/setup-ruby@v1.133.0
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
bundler-cache: true
cache-version: ${{ matrix.database }}
- name: Set up Node
uses: actions/setup-node@v3
with:
Expand All @@ -36,5 +45,6 @@ jobs:
with:
chrome-version: stable
- run: chrome --version
- run: bundle exec rake parallel:setup
- run: bin/rails db:setup
- run: bin/rake parallel:setup
- run: bin/rake
2 changes: 2 additions & 0 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ test:
adapter: postgresql
database: bridgetroll_test<%= ENV['TEST_ENV_NUMBER'] %>
host: localhost
user: <%= ENV["POSTGRES_USER"] %>
password: <%= ENV["POSTGRES_PASSWORD"] %>
<% end %>

staging:
Expand Down

0 comments on commit b0358a2

Please sign in to comment.