Skip to content

Commit

Permalink
Cache bundler on CI using setup-ruby (#102)
Browse files Browse the repository at this point in the history
We're manually bundling, but `setup-ruby` can do it for us.

This also upgrades postgresql on CI.
  • Loading branch information
parndt authored Jul 9, 2021
1 parent a7b965d commit ff40ffd
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,23 @@ jobs:
runs-on: ubuntu-latest

env:
BUNDLE_JOBS: 4
BUNDLE_PATH: vendor/bundle
CI: true
DB: ${{ matrix.database }}
MYSQL_PASSWORD: root
PGHOST: localhost
PGUSER: postgres
PGPASSWORD: postgres
RAILS_ENV: test

name: ${{ matrix.ruby }} ${{ matrix.database }}
steps:
- run: sudo apt-get update && sudo apt-get install libpq-dev libmysqlclient-dev libsqlite3-dev -y
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
- run: sudo apt-get update && sudo apt-get install libpq-dev libmysqlclient-dev libsqlite3-dev -y
- run: sudo systemctl start mysql.service
- id: cache-bundler
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ matrix.ruby }}-gem-${{ matrix.database }}-${{ hashFiles('Gemfile') }}
- run: bundle install --without development --path vendor/bundle
- run: bin/rake refinery:testing:dummy_app
env:
PGPORT: ${{ job.services.postgres.ports[5432] }}
Expand All @@ -47,6 +41,12 @@ jobs:

services:
postgres:
image: postgres:11.5
image: postgres
env:
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

0 comments on commit ff40ffd

Please sign in to comment.