Skip to content

Merge remote-tracking branch 'origin/develop' into feature/fas-572-wi… #1756

Merge remote-tracking branch 'origin/develop' into feature/fas-572-wi…

Merge remote-tracking branch 'origin/develop' into feature/fas-572-wi… #1756

Workflow file for this run

name: Tests
on: [push]
jobs:
rspec:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: voie_rapide
POSTGRES_DB: voie_rapide_test
POSTGRES_PASSWORD: wow*veryrapide
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v7
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4.5
bundler-cache: true
- name: Install dependencies
run: |
bundle install
- name: Setup database
env:
RAILS_ENV: test
DATABASE_URL: postgres://voie_rapide:wow*veryrapide@localhost:5432/voie_rapide_test
run: |
bundle exec rails db:create
bundle exec rails db:schema:load
- name: Run RSpec tests
env:
RAILS_ENV: test
DATABASE_URL: postgres://voie_rapide:wow*veryrapide@localhost:5432/voie_rapide_test
run: |
bundle exec rspec
cucumber:
runs-on: ubuntu-latest
strategy:
matrix:
node: [0, 1]
fail-fast: false
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: voie_rapide
POSTGRES_DB: voie_rapide_test
POSTGRES_PASSWORD: wow*veryrapide
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v7
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4.5
bundler-cache: true
- name: Install dependencies
run: |
bundle install
- name: Setup database
env:
RAILS_ENV: test
DATABASE_URL: postgres://voie_rapide:wow*veryrapide@localhost:5432/voie_rapide_test
run: |
bundle exec rails db:create
bundle exec rails db:schema:load
- name: Run Cucumber tests (shard ${{ matrix.node }})
env:
RAILS_ENV: test
DATABASE_URL: postgres://voie_rapide:wow*veryrapide@localhost:5432/voie_rapide_test
CUCUMBER_PUBLISH_QUIET: true
run: |
FEATURES=$(wc -l features/*.feature | grep feature | sort -rn | awk '{print $2}' | \
awk -v shard=${{ matrix.node }} '{ if (NR % 2 == shard) print }')
bundle exec cucumber --tags "not @wip" $FEATURES
deploy-sandbox:
needs: [rspec, cucumber]
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
app:
- { name: voie_rapide_sandbox, host_prefix: host }
- { name: voie_rapide_edition_sandbox, host_prefix: host }
host: [services1, services2]
fail-fast: false
environment: sandbox
env:
DEPLOY_HTTPS_LOGIN: ${{ secrets.DEPLOY_HTTPS_LOGIN }}
DEPLOY_HTTPS_PASSWORD: ${{ secrets.DEPLOY_HTTPS_PASSWORD }}
DEPLOY_HTTPS_REQUEST_URL: ${{ vars.DEPLOY_HTTPS_REQUEST_URL }}
DEPLOY_HTTPS_RESPONSE_URL: ${{ vars.DEPLOY_HTTPS_RESPONSE_URL }}
DEPLOY_HOST: ${{ matrix.app.host_prefix }}_${{ matrix.host }}
DEPLOY_APP: ${{ matrix.app.name }}
DEPLOY_BRANCH: develop
steps:
- name: Download and run deploy script
shell: bash
run: |
git clone https://github.com/etalab/api-entreprise-integration
cd api-entreprise-integration
./deploy-parteprise.sh