admin removed from exception #23
This file contains hidden or 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: 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/models/organisation_test.rb | |
build: | |
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: | |
- uses: actions/checkout@v4 | |
- uses: hatchboxio/github-hatchbox-deploy-action@v2 | |
with: | |
deploy_key: ${{ secrets.HATCHBOX_DEPLOY_KEY }} |