Feature/about section #131
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
rubocop: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: Install jq | |
run: sudo apt-get install -y jq libjq-dev libonig5 libonig-dev | |
- name: Install dependencies | |
run: bundle install | |
- name: Run linter | |
run: bundle exec rake rubocop | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby: ['3.1'] | |
# Service containers to run with `runner-job` | |
services: | |
# Label used to access the service container | |
redis: | |
# Docker Hub image | |
image: redis | |
# Set health checks to wait until redis has started | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps port 6379 on service container to the host | |
- 6379:6379 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
- name: Create Solr container | |
run: docker run -d -p 8983:8983 geoblacklight/solr:8.9-v1.0.0 server/scripts/ci-start.sh | |
- name: Install jq | |
run: sudo apt-get install -y jq libjq-dev libonig5 libonig-dev | |
- name: Install bundler | |
run: gem install bundler -v 2.3.17 | |
- name: Install dependencies | |
run: bundle _2.3.17_ install | |
env: | |
rails_version: 6.1.6 | |
- name: Setup Yarn | |
run: exec "yarnpkg" | |
- name: Load config into solr | |
run: | | |
cd solr/conf | |
zip -1 -r solr_config.zip ./* | |
curl -H "Content-type:application/octet-stream" --data-binary @solr_config.zip "http://solr:SolrRocks@127.0.0.1:8983/solr/admin/configs?action=UPLOAD&name=blacklight" | |
curl -H 'Content-type: application/json' http://solr:SolrRocks@127.0.0.1:8983/api/collections/ -d '{create: {name: blacklight-core, config: blacklight, numShards: 1}}' | |
- name: Rails - Database setup | |
env: | |
RAILS_ENV: test | |
run: | | |
bin/rails db:schema:load | |
bin/rails db:migrate | |
- name: Run tests | |
run: bundle exec rake ci | |
env: | |
rails_version: 6.1.6 | |
ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test' | |
SOLR_URL: http://solr:SolrRocks@localhost:8983/solr/blacklight-core | |
FARADAY_VERSION: ${{ matrix.faraday_version }} | |
KALTURA_PARTNER_ID: bogus | |
KALTURA_PLAYER_UICONF_ID_SINGLE: bogus | |
KALTURA_PLAYER_UICONF_ID_COMPOUND: bogus | |
- name: Upload coverage artifacts | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: coverage | |
path: coverage/ |