Skip to content
Open

V4 #41

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
93 changes: 0 additions & 93 deletions .circleci/config.yml

This file was deleted.

113 changes: 70 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Test

on:
push:
branches: [ main, develop ]
branches: [main, develop]
pull_request:
branches: [ main, develop ]
branches: [main, develop]

env:
RAILS_ENV: test
Expand All @@ -13,14 +13,31 @@ env:
DB_USERNAME: postgres
DB_PASSWORD: postgres
TEST_DB_NAME: otb_test
CI: 'github-actions'
BROWSER_PATH: /usr/bin/google-chrome
CI: "github-actions"
BROWSER_PATH: /usr/bin/chromium-browser
RAILS_MASTER_KEY: ${{ secrets.MASTER_KEY }}

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm

services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.2
env:
STACK_VERSION: 7.17.1
xpack.security.enabled: false
cluster.name: otb-elasticsearch
http.port: 9200
discovery.type: single-node
options: >-
--health-cmd "curl http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 9200:9200

postgres:
image: postgres:13
env:
Expand All @@ -35,47 +52,57 @@ jobs:
ports:
- 5432:5432

redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2
bundler-cache: true
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4.4
bundler-cache: true

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client imagemagick libpq-dev gdal-bin libgdal-dev fonts-liberation
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb || true
sudo apt-get install -f -y
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client imagemagick libpq-dev gdal-bin libgdal-dev fonts-liberation libmagickwand-dev libvips chromium-browser
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb || true
sudo apt-get install -f -y

- name: Create required directories
run: |
sudo mkdir -p /data/tmp
sudo chmod 777 /data/tmp
sudo chown $USER:$USER /data/tmp
mkdir -p public/storage/tmp
chmod 777 public/storage/tmp
- name: Create required directories
run: |
sudo mkdir -p /data/tmp
sudo chmod 777 /data/tmp
sudo chown $USER:$USER /data/tmp
mkdir -p public/storage/tmp
chmod 777 public/storage/tmp

- name: Wait for database to be ready
run: |
until pg_isready -h localhost -p 5432 -U postgres; do
echo "Waiting for PostgreSQL..."
sleep 2
done
- name: Wait for database to be ready
run: |
until pg_isready -h localhost -p 5432 -U postgres; do
echo "Waiting for PostgreSQL..."
sleep 2
done

- name: Set up PostgreSQL database
run: |
export DB_ADAPTER=postgresql
bundle exec rake db:drop RAILS_ENV=test DB_ADAPTER=postgresql || true
bundle exec rake db:create RAILS_ENV=test DB_ADAPTER=postgresql
bundle exec rake db:schema:load RAILS_ENV=test DB_ADAPTER=postgresql
bundle exec rake db:migrate RAILS_ENV=test DB_ADAPTER=postgresql
- name: Set up PostgreSQL database
run: |
export DB_ADAPTER=postgresql
bundle exec rake db:drop RAILS_ENV=test DB_ADAPTER=postgresql || true
bundle exec rake db:create RAILS_ENV=test DB_ADAPTER=postgresql
bundle exec rake db:schema:load RAILS_ENV=test DB_ADAPTER=postgresql
bundle exec rake db:migrate RAILS_ENV=test DB_ADAPTER=postgresql

- name: Run RSpec tests
run: |
DB_ADAPTER=postgresql bundle exec rspec --format progress
- name: Run RSpec tests
run: |
DB_ADAPTER=postgresql bundle exec rspec --format progress
Loading
Loading