-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (140 loc) · 4.62 KB
/
build.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
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: 'hyraxapp@example.com'
EMAIL_GEONAMES_ERRORS_ADDRESS: 'hyraxapp@example.com'
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:8.11-slim
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: Copy solr config into docker container
run: docker cp solr/config solr_container:/tmp/solr_config
- name: Create Solr core
run: docker exec solr_container solr create -c hydra-test -d /tmp/solr_config
- 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@v3
with:
name: test-coverage
path: coverage
- uses: actions/upload-artifact@v3
with:
name: test-coverage-report
path: coverage/coverage.json
- name: Report to CodeClimate
uses: paambaati/codeclimate-action@v3.0.0
with:
debug: false
coverageLocations: |
${{github.workspace}}/coverage/coverage.json:simplecov