diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..23f5f9f54b --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Gemfile b/Gemfile index bcb0663688..90bb93c5f2 100755 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 3e442f22b3..866c946ca6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -782,7 +780,6 @@ DEPENDENCIES passenger pg (>= 0.18, < 2.0) pg_ltree (= 1.1.8) - pg_query pg_search phonelib prometheus_exporter diff --git a/Rakefile b/Rakefile index 3e01c2e0c0..94b4c57f26 100644 --- a/Rakefile +++ b/Rakefile @@ -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?