Skip to content

v1.8.b github action : test bad flow not deployed #16

v1.8.b github action : test bad flow not deployed

v1.8.b github action : test bad flow not deployed #16

Workflow file for this run

name: Ruby on Rails CI
on:
push:
branches:
- main
- staging
pull_request:
branches:
- main
- staging
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: test_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.5
- name: Install dependencies
run: |
gem install bundler
bundle install
- name: Set up database and run tests
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/test
REDIS_URL: redis://localhost:6379/0
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
PG_USER: postgres
run: |
bin/rails db:test:prepare
bin/rails test test/controllers/pages_controller_test.rb
deploy:
runs-on: ubuntu-latest
needs: test # Attend que les tests réussissent avant d'exécuter ce job
if: success() # Ne s'exécute que si les tests réussissent
steps:
- name: Trigger deployment to Hatchbox
run: |
curl -X GET https://app.hatchbox.io/apps/8114/hooks