Skip to content

Commit

Permalink
CI: try new ci task setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Nov 6, 2023
1 parent 289c3cd commit 72281f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ jobs:
bin/rails db:migrate RAILS_ENV=test
- name: Rails - Run tests
run: bundle exec rake ci
env:
RAILS_ENV: test
rails_version: 6.1.5
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 }}
run: bundle exec rake ci


- name: Artifacts - Upload coverage
uses: actions/upload-artifact@v2
Expand Down
17 changes: 5 additions & 12 deletions lib/tasks/geoportal.rake
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# frozen_string_literal: true

desc 'Run test suite'
task :ci do
shared_solr_opts = { managed: true, verbose: true, persist: false, download_dir: 'tmp' }
shared_solr_opts[:version] = ENV['SOLR_VERSION'] if ENV['SOLR_VERSION']

success = true
SolrWrapper.wrap(shared_solr_opts.merge(port: 8985, instance_dir: 'tmp/geoportal-core-test')) do |solr|
solr.with_collection(name: "geoportal-core-test", dir: Rails.root.join("solr", "conf").to_s) do
system 'RAILS_ENV=test bundle exec rake geoportal:index:seed'
system('RAILS_ENV=test bundle exec rails test:system test') || success = false
end
if Rails.env.test?
success = true
Rake::Task['geoportal:index:seed'].invoke
system('RAILS_ENV=test bundle exec rails test:system test') || success = false
exit!(1) unless success
end

exit!(1) unless success
end

namespace :geoportal do
Expand Down

0 comments on commit 72281f6

Please sign in to comment.