HYC-1968 - Solr 9 #2083
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main, hyrax-4 ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
CC_TEST_REPORTER_ID: ab9f6d96726a23c491c04cdad5cc4959551f10716196aaf2260bdf72ca1a3d0b | |
ALLOW_NOTIFICATIONS: true | |
CLAMD_TCP_HOST: 'localhost' | |
CLAMD_TCP_PORT: '3310' | |
DATABASE_AUTH: true | |
DATABASE_URL: postgresql://localhost:5432 | |
DATACITE_PASSWORD: 'datacitepass' | |
DATACITE_PREFIX: '10.5077' | |
DATACITE_USER: 'test-datacite-user' | |
DATACITE_USE_TEST_API: 'true' | |
DATA_STORAGE: ./public | |
TEMP_STORAGE: ./public | |
DEFAULT_ADMIN_SET: 'default' | |
DELETED_PEOPLE_FILE: ./tmp/deleted_people.txt | |
DOI_PREFIX: '10.17615' | |
EMAIL_FROM_ADDRESS: '[email protected]' | |
EMAIL_GEONAMES_ERRORS_ADDRESS: '[email protected]' | |
FEDORA_TEST_URL: http://localhost:8080/fcrepo/rest | |
HYRAX_DATABASE_PASSWORD: 'password' | |
HYRAX_HOST: 'https://example.com' | |
NOKOGIRI_USE_SYSTEM_LIBRARIES: true | |
RACK_ENV: test | |
RAILS_ENV: test | |
REDIS_HOST: localhost | |
REDIS_URL: redis://redis | |
SOLR_TEST_URL: http://127.0.0.1:8983/solr/hydra-test | |
SSO_LOGIN_PATH: '/Shibboleth.sso/Login' | |
SSO_LOGOUT_URL: 'https://shibboleth.example.com/idp/logout.jsp' | |
IMAGE_PROCESSOR: 'graphicsmagick' | |
services: | |
fedora: | |
image: cazzerson/fcrepo4:4.7.5 | |
ports: | |
- 8080:8080 | |
env: | |
CATALINA_OPTS: "-Djava.awt.headless=true -server -Xms1G -Xmx2G -XX:MaxNewSize=1G -XX:+HeapDumpOnOutOfMemoryError -Dfcrepo.modeshape.configuration=classpath:/config/file-simple/repository.json" | |
redis: | |
image: redis | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: hyrax | |
POSTGRES_PASSWORD: password | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
ports: ["5432:5432"] | |
solr: | |
image: solr:9 | |
ports: | |
- 8983:8983 | |
options: >- | |
--name solr_container | |
clamavd: | |
image: lokori/clamav-java | |
ports: | |
- 3310:3310 | |
volumes: | |
- /tmp:/tmp | |
strategy: | |
matrix: | |
ruby-version: ['3.0.4'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, | |
# change this to (see https://github.com/ruby/setup-ruby#versioning): | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Update rubygems | |
run: | | |
gem update --system 3.3.25 | |
gem install bundler:2.3.27 | |
# Run Rubocop as soon as gems are installed, so we fail early if there are issues | |
- name: Run RuboCop | |
run: bundle exec rubocop --parallel --config .rubocop.yml | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Install OS packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install unzip ghostscript libpq-dev graphicsmagick libreoffice | |
- name: Setup test database | |
env: | |
RAILS_ENV: test | |
PGHOST: localhost | |
PGUSER: hyrax | |
# Variable needs to be PGPASSWORD so postgres cli can read it. | |
# Variable is supposedly deprecated in postgres, but can't find the notice in postgres docs | |
PGPASSWORD: password | |
run: | | |
psql -c 'create database hyrax_test with owner hyrax;' | |
- name: Create ConfigSet Directory | |
run: docker exec solr_container bash -c "mkdir -p /var/solr/configsets/hy-c/conf" | |
- name: Copy Solr Config into container | |
run: docker cp ./solr/config/. solr_container:/var/solr/configsets/hy-c/conf | |
- name: List Solr Config Directory | |
run: docker exec solr_container bash -c "ls -la /var/solr/configsets/hy-c/conf" | |
- name: List libs | |
run: docker exec solr_container bash -c "ls -la /opt/solr/contrib/analysis-extras/lib" | |
- name: Debug Classpath | |
run: docker exec solr_container bash -c 'echo $(find /opt/solr/ -name "*.jar" | tr "\n" ":")' | |
- name: Create Solr core | |
run: docker exec solr_container solr create_core -c hydra-test -d /var/solr/configsets/hy-c | |
- name: Fetch Solr container logs | |
run: docker logs $(docker ps -q -f ancestor=solr:9) | |
- name: Wait for Solr to start | |
run: | | |
for i in {1..30}; do | |
curl -s http://127.0.0.1:8983/solr/admin/cores?action=STATUS | grep -q '"hydra-test"' && break | |
echo "Waiting for Solr to initialize..." | |
sleep 2 | |
done | |
if ! curl -s http://127.0.0.1:8983/solr/admin/cores?action=STATUS | grep -q '"hydra-test"'; then | |
echo "Solr did not initialize in time" | |
exit 1 | |
fi | |
- name: Run rspec tests | |
run: bundle exec rspec | |
env: | |
REDIS_URL: redis://redis | |
POSTGRES_USER: hyrax | |
POSTGRES_PASSWORD: password | |
TMPDIR: /tmp | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: test-coverage | |
path: coverage | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: test-coverage-report | |
path: coverage/coverage.json | |
- name: Report to CodeClimate | |
uses: paambaati/[email protected] | |
with: | |
debug: false | |
coverageLocations: | | |
${{github.workspace}}/coverage/coverage.json:simplecov |