Skip to content

[PSD-2562]- Roll out use-new-search to everyone #89

[PSD-2562]- Roll out use-new-search to everyone

[PSD-2562]- Roll out use-new-search to everyone #89

Workflow file for this run

name: CI
on:
push:
env:
DATABASE_URL: postgres://postgres@localhost:5432
OPENSEARCH_URL: http://localhost:9200
REDIS_URL: redis://localhost:6379
RAILS_ENV: test
ANTIVIRUS_URL: http://localhost:3006/safe
ANTIVIRUS_USERNAME: av
ANTIVIRUS_PASSWORD: password
PSD_HOST: example.com
PSD_HOST_SUPPORT: example.com
PSD_HOST_REPORT: example.com
EMAIL_WHITELIST_ENABLED: false
TWO_FACTOR_AUTHENTICATION_ENABLED: false
CI: true
jobs:
ruby:
name: "Rspec"
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
POSTGRES_DB: postgres
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
opensearch:
image: opensearchproject/opensearch:1.2.3
env:
DISABLE_SECURITY_PLUGIN: true
ports: ["9200:9200"]
options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server
strategy:
fail-fast: false
matrix:
rspec-folder:
- spec/active_model
- spec/decorators
- spec/forms
- spec/helpers spec/jobs spec/mailers spec/policies
- spec/models spec/validators
- spec/requests
- --tag with_opensearch spec/features
- --tag ~with_opensearch spec/features
- --tag with_opensearch spec/services
- --tag ~with_opensearch spec/services
- $(ls -d spec/*/ | grep -v -E 'decorators|models|active_model|forms|jobs|mailers|requests|features|policies|services|helpers|validators')
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18.15.x
- name: Install PostgreSQL client
run: sudo apt-get install libpq-dev
- uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-no-dev-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install RubyGems
run: |
gem install bundler --no-doc
bundle config path vendor/bundle
bundle check || bundle install --without development --jobs=4 --retry=3
- name: Install yarn
run: npm install yarn -g
- name: Get yarn cache
id: yarn-cache
run: |
echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Prepare database
run: bin/rails parallel:load_schema
- name: Prepare assets for tests
run: bin/rails test:prepare
- name: Run specs
run: |
bundle exec rspec ${{ matrix.rspec-folder }}
# - name: Coveralls
# uses: coverallsapp/github-action@v2
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Dump docker logs
uses: jwalton/gh-docker-logs@v2
if: always()
with:
images: 'opensearchproject/opensearch'
- uses: actions/upload-artifact@v4
if: failure()
with:
name: capybara screenshots
path: tmp/capybara