From 47fbd8ffca986c70783ea1affba5a6e31d3f83d9 Mon Sep 17 00:00:00 2001 From: kapill65chhpatel <kapil@cottagelabs.com> Date: Wed, 25 May 2022 16:44:29 +0530 Subject: [PATCH] Added config.yml file for circleci --- hyrax/.circleci/config.yml | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 hyrax/.circleci/config.yml diff --git a/hyrax/.circleci/config.yml b/hyrax/.circleci/config.yml new file mode 100644 index 00000000..11db426e --- /dev/null +++ b/hyrax/.circleci/config.yml @@ -0,0 +1,50 @@ +version: 2.1 +orbs: + ruby: circleci/ruby@1.4.0 + +jobs: + build: + docker: + - image: cimg/ruby:2.7.6-node + - image: circleci/postgres:12-alpine + environment: + POSTGRES_USER: 'postgres' + POSTGRES_DB: 'hyrax_test' + - image: cimg/redis:6.2.6 + steps: + - checkout + - restore_cache: + keys: + - rails-demo-{{ checksum "hyrax/Gemfile.lock" }} + - rails-demo- + - run: + name: bundle install + command: | + cd hyrax + bundle install --jobs 4 --retry 3 + - run: + name: download fits + command: | + export FITS_ROOT=~/rdms-hyrax/ + mkdir -p ${FITS_ROOT} + wget -q https://github.com/harvard-lts/fits/releases/download/1.5.0/fits-1.5.0.zip -O ${FITS_ROOT}/fits-1.5.0.zip + unzip -q ${FITS_ROOT}/fits-1.5.0.zip -d ${FITS_ROOT}/fits-1.5.0 + chmod a+x ${FITS_ROOT}/fits-1.5.0/fits.sh + rm ${FITS_ROOT}/fits-1.5.0.zip + - run: + name: prepare database + command: | + cd hyrax + bundle exec rake db:test:prepare + - run: + name: run tests + command: | + cd hyrax + export FITS_PATH=~/rdms-hyrax/fits-1.3.0/fits.sh + TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)" + if test -f "lib/tasks/test_servers.rake"; then echo 'Running full tests' && bundle exec rake test:servers:start && bundle exec rspec && bundle exec rake test:servers:stop; else echo "Running limited tests"; bundle exec rspec --exclude-pattern "**/features/*_spec.rb"; fi + - store_test_results: + path: /tmp/test-results + - store_artifacts: + path: /tmp/test-results + destination: test-results -- GitLab