Updating ruby base image and bundler version in Dockerfile #197
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: | |
- 2.7 | |
postgres_image: | |
- postgis/postgis:12-3.3 | |
services: | |
postgres: | |
image: ${{ matrix.postgres_image }} | |
env: | |
POSTGRES_PASSWORD: bety | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Restore cache | |
uses: actions/cache@v1 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ matrix.ruby}}-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
- name: Set up Ruby ${{ matrix.ruby }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
- name: Install libraries | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install libgeos-dev | |
- name: Install gems | |
run: | | |
gem install bundler -v 1.17.3 | |
bundle config path vendor/bundle | |
bundle config without 'javascript_testing' | |
bundle config with 'docker' | |
bundle config | |
bundle install --jobs 4 --retry 3 | |
- name: Build and test with Rake | |
env: | |
RAILS_ENV: test | |
POSTGRES_PASSWORD: bety | |
PGPASSWORD: bety | |
run: | | |
cp config/database.yml.gh config/database.yml | |
psql -h localhost -U postgres -c "CREATE USER bety WITH SUPERUSER CREATEDB PASSWORD 'bety'"; | |
psql -h localhost -U postgres -c "DROP DATABASE IF EXISTS test;" | |
psql -h localhost -U postgres -c "CREATE DATABASE test WITH OWNER bety;" | |
psql -h localhost -U bety -d test -c "CREATE EXTENSION postgis;" | |
#bundle exec rails db:create | |
# bundle exec rails db:migrate | |
bundle exec rake db:structure:load | |
bundle exec rake db:fixtures:load | |
mkdir -p spec/tmp | |
bundle exec rails test | |
bundle exec rspec --tag ~js | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build image | |
run: docker build --tag image --file Dockerfile . |