Skip to content
Closed

Add CI #5601

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Suite Tests

on:
pull_request:

env:
RAILS_ENV: production

# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec standardrb

suite-tests:
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
needs:
- linting
runs-on: ubuntu-latest
env:
RAILS_ENV: test
NODE_ENV: test
NODE_OPTIONS: --openssl-legacy-provider
SIMPLE_SERVER_DATABASE_HOST: localhost
SIMPLE_SERVER_DATABASE_USERNAME: postgres
SIMPLE_SERVER_DATABASE_PASSWORD: postgres
TEST_ENV_NUMBER: 1
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: actions/setup-node@v4
with:
node-version: 18.11.0
cache: 'yarn'
- name: Install Node Packages
run: yarn install --frozen-lockfile
- name: Setup DB
run: |
bundle exec rake parallel:create
bundle exec rake parallel:setup
- name: Refresh Materialized Views
run: bundle exec rake db:refresh_matviews
- name: Precompile assets
run: bundle exec rake assets:precompile
- name: Run Tests
run: bundle exec rake parallel:spec
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ group :development, :test, :profiling do
gem "derailed_benchmarks"
gem "memory_profiler", require: false
gem "prosopite"
gem "pg_query"
end

group :development do
Expand Down
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,6 @@ GEM
pg_ltree (1.1.8)
activerecord (>= 4.0.0, <= 7.0.0.rc1)
pg (>= 0.17.0, < 2)
pg_query (2.1.4)
google-protobuf (>= 3.19.2)
pg_search (2.3.6)
activerecord (>= 5.2)
activesupport (>= 5.2)
Expand Down Expand Up @@ -782,7 +780,6 @@ DEPENDENCIES
passenger
pg (>= 0.18, < 2.0)
pg_ltree (= 1.1.8)
pg_query
pg_search
phonelib
prometheus_exporter
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require_relative "config/application"
require "prometheus_exporter/client"

Rails.application.load_tasks

def is_running_migration?
Expand Down
Loading