summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorjsgoldstein <jakegoldstein95@gmail.com>2023-09-08 10:17:55 -0400
committerGitHub <noreply@github.com>2023-09-08 16:17:55 +0200
commit4d9186a48c494bdd098f7a6273c3f0bf4dc5e19a (patch)
treee18158e06539a3bcb94cf6b3bd8094f29a90b727 /.github
parent3a679844e499df026be7d5b3a9e80e5bf3ad585a (diff)
Add search tests (#26703)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/test-ruby.yml113
1 files changed, 113 insertions, 0 deletions
diff --git a/.github/workflows/test-ruby.yml b/.github/workflows/test-ruby.yml
index ff135867f93..ecded2cc2fa 100644
--- a/.github/workflows/test-ruby.yml
+++ b/.github/workflows/test-ruby.yml
@@ -250,3 +250,116 @@ jobs:
with:
name: e2e-screenshots
path: tmp/screenshots/
+
+ test-search:
+ name: Testing search
+ runs-on: ubuntu-latest
+
+ needs:
+ - build
+
+ services:
+ postgres:
+ image: postgres:14-alpine
+ env:
+ POSTGRES_PASSWORD: postgres
+ POSTGRES_USER: postgres
+ options: >-
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+ ports:
+ - 5432:5432
+
+ redis:
+ image: redis:7-alpine
+ options: >-
+ --health-cmd "redis-cli ping"
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+ ports:
+ - 6379:6379
+
+ elasticsearch:
+ image: docker.elastic.co/elasticsearch/elasticsearch:7.17.9
+ env:
+ discovery.type: single-node
+ xpack.security.enabled: false
+ options: >-
+ --health-cmd "curl http://localhost:9200/_cluster/health"
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 10
+ ports:
+ - 9200:9200
+
+ env:
+ DB_HOST: localhost
+ DB_USER: postgres
+ DB_PASS: postgres
+ DISABLE_SIMPLECOV: true
+ RAILS_ENV: test
+ BUNDLE_WITH: test
+ ES_ENABLED: true
+ ES_HOST: localhost
+ ES_PORT: 9200
+
+ strategy:
+ fail-fast: false
+ matrix:
+ ruby-version:
+ - '3.0'
+ - '3.1'
+ - '.ruby-version'
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: actions/download-artifact@v3
+ with:
+ path: './public'
+ name: ${{ github.sha }}
+
+ - name: Update package index
+ run: sudo apt-get update
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v3
+ with:
+ cache: yarn
+ node-version-file: '.nvmrc'
+
+ - name: Install native Ruby dependencies
+ run: sudo apt-get install -y libicu-dev libidn11-dev
+
+ - name: Install additional system dependencies
+ run: sudo apt-get install -y ffmpeg imagemagick
+
+ - name: Set up bundler cache
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby-version}}
+ bundler-cache: true
+
+ - run: yarn --frozen-lockfile
+
+ - name: Load database schema
+ run: './bin/rails db:create db:schema:load db:seed'
+
+ - run: bundle exec rake spec:search
+
+ - name: Archive logs
+ uses: actions/upload-artifact@v3
+ if: failure()
+ with:
+ name: test-search-logs-${{ matrix.ruby-version }}
+ path: log/
+
+ - name: Archive test screenshots
+ uses: actions/upload-artifact@v3
+ if: failure()
+ with:
+ name: test-search-screenshots
+ path: tmp/screenshots/