-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (83 loc) · 2.93 KB
/
ruby.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.1
- name: Install dependencies
run: bundle install
- name: Run linter
run: bundle exec standardrb
aardvark-fixture-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.1
- name: Install json schema validator
run: gem install json_schemer
- name: Run json_schemer against aarkvark fixtures
run: find test/fixtures/files/** -type f -name "*.json" | xargs json_schemer schema/geoblacklight-schema-aardvark.json
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby_version: ['3.2.1']
rails_version: [7.0.4.2]
bundler_version: [2.1.1]
faraday_version: ['>= 2']
name: test ruby ${{ matrix.ruby_version }} / rails ${{ matrix.rails_version }} / faraday ${{ matrix.faraday_version }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
- 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 bundler
run: gem install bundler -v ${{ matrix.bundler_version }}
- name: Force platform
run: bundle config set force_ruby_platform true
- name: Install dependencies
run: bundle _${{ matrix.bundler_version }}_ install
env:
RAILS_VERSION: ${{ matrix.rails_version }}
FARADAY_VERSION: ${{ matrix.faraday_version }}
- 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:[email protected]:8983/solr/admin/configs?action=UPLOAD&name=blacklight"
curl -H 'Content-type: application/json' http://solr:[email protected]:8983/api/collections/ -d '{create: {name: blacklight-core, config: blacklight, numShards: 1}}'
- name: Run tests
run: bundle exec rake ci
env:
SOLR_VERSION: 8.9.0
RAILS_VERSION: ${{ matrix.rails_version }}
FARADAY_VERSION: ${{ matrix.faraday_version }}
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
- name: Upload coverage artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: coverage
path: coverage/