Skip to content

Commit 981bc2a

Browse files
Merge remote-tracking branch 'origin/pr/fix-zipped-sumbission-remote-pull' into pr/fix-zipped-sumbission-remote-pull
2 parents 2f3f4cb + 6b70505 commit 981bc2a

32 files changed

Lines changed: 1333 additions & 352 deletions

.dockerignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Git
2-
#.git
2+
.git
3+
.github
34
.gitignore
45
# Logs
56
log/*
@@ -8,3 +9,9 @@ tmp/*
89
# Editor temp files
910
*.swp
1011
*.swo
12+
coverage
13+
create_permissions.log
14+
# Ignore generated test data
15+
test/data/dictionary.txt
16+
test/data/ontology_files/repo/**/*
17+
test/data/tmp/*

.github/workflows/docker-image.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Docker Image CI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
push_to_registry:
9+
name: Push Docker image to Docker Hub
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out the repo
13+
uses: actions/checkout@v3
14+
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v2
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v2
20+
21+
- name: Log in to Docker Hub
22+
uses: docker/login-action@v2
23+
with:
24+
username: ${{ secrets.DOCKERHUB_USERNAME }}
25+
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
27+
- name: Extract metadata (tags, labels) for Docker
28+
id: meta
29+
uses: docker/metadata-action@v4
30+
with:
31+
images: bioportal/ncbo_cron
32+
33+
- name: Build and push Docker image
34+
uses: docker/build-push-action@v4
35+
with:
36+
context: .
37+
platforms: linux/amd64,linux/arm64
38+
build-args: |
39+
RUBY_VERSION=2.7
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/ruby-unit-tests.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,25 @@ on:
66

77
jobs:
88
test:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
backend: ['ncbo_cron', 'ncbo_cron-agraph'] # ruby runs tests with 4store backend and ruby-agraph runs with AllegroGraph backend
913
runs-on: ubuntu-latest
1014
steps:
11-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1216
- name: copy config.rb file from template
1317
run: cp config/config.test.rb config/config.rb
1418
- name: Build docker-compose
15-
working-directory: ./test
1619
run: docker-compose build
1720
- name: Run unit tests
18-
working-directory: ./test
19-
run: docker-compose run unit-test wait-for-it solr-ut:8983 -- rake test TESTOPTS='-v'
21+
run: |
22+
ci_env=`bash <(curl -s https://codecov.io/env)`
23+
docker-compose run $ci_env -e CI --rm ${{ matrix.backend }} bundle exec rake test TESTOPTS='-v'
24+
- name: Upload coverage reports to Codecov
25+
uses: codecov/codecov-action@v3
26+
with:
27+
flags: unittests
28+
verbose: true
29+
fail_ci_if_error: false # optional (default = false)
2030

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
config/config.rb
44
config/config_*.rb
55
config/*.p12
6+
config/*.json
7+
data/
68
projectFilesBackup/
79
.ruby-version
810
repo*
@@ -11,6 +13,9 @@ repo*
1113
.DS_Store
1214
tmp
1315

16+
# Code coverage reports
17+
coverage*
18+
1419
# Ignore eclipse .project
1520
.project
1621
.pmd

Dockerfile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
1-
FROM ruby:2.6
1+
ARG RUBY_VERSION
2+
ARG DISTRO_NAME=bullseye
23

3-
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends openjdk-11-jre-headless raptor2-utils wait-for-it
4+
FROM ruby:$RUBY_VERSION-$DISTRO_NAME
5+
6+
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
7+
openjdk-11-jre-headless \
8+
raptor2-utils \
9+
&& rm -rf /var/lib/apt/lists/*
410

5-
# The Gemfile Caching Trick
6-
# we install gems before copying the code in its own layer so that gems would not have to get
7-
# installed every single time code is updated
811
RUN mkdir -p /srv/ontoportal/ncbo_cron
12+
RUN mkdir -p /srv/ontoportal/bundle
913
COPY Gemfile* *.gemspec /srv/ontoportal/ncbo_cron/
14+
1015
WORKDIR /srv/ontoportal/ncbo_cron
11-
RUN gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
16+
17+
RUN gem update --system
18+
RUN gem install bundler
19+
ENV BUNDLE_PATH=/srv/ontoportal/bundle
1220
RUN bundle install
21+
1322
COPY . /srv/ontoportal/ncbo_cron
14-
#CMD ["bundle","exec","rackup","-p","9393","--host","0.0.0.0"]
23+
RUN cp /srv/ontoportal/ncbo_cron/config/config.rb.sample /srv/ontoportal/ncbo_cron/config/config.rb
24+
25+
CMD ["/bin/bash"]

Gemfile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ source 'https://rubygems.org'
22

33
gemspec
44

5-
gem 'faraday', '~> 1.9'
65
gem 'ffi'
7-
gem 'google-api-client', '~> 0.10'
6+
gem 'google-analytics-data'
87
gem 'mail', '2.6.6'
9-
gem 'minitest', '< 5.0'
108
gem 'multi_json'
11-
gem 'oj', '~> 2.0'
9+
gem 'oj', '~> 3.0'
1210
gem 'parseconfig'
1311
gem 'pony'
1412
gem 'pry'
@@ -20,16 +18,16 @@ gem 'sys-proctable'
2018
# Monitoring
2119
gem 'cube-ruby', require: 'cube'
2220

23-
# NCBO gems (can be from a local dev path or from rubygems/git)
24-
21+
# NCBO
2522
gem 'goo', github: 'ncbo/goo', branch: 'master'
2623
gem 'ncbo_annotator', github: 'ncbo/ncbo_annotator', branch: 'master'
27-
gem 'ontologies_linked_data', github: 'ontoportal-lirmm/ontologies_linked_data', branch: 'pl/enhance-zipped-submissions-support'
24+
gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'master'
2825
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'master'
2926

30-
# Testing
3127
group :test do
3228
gem 'email_spec'
29+
gem 'minitest', '< 5.0'
30+
gem 'simplecov'
31+
gem 'simplecov-cobertura' # for codecov.io
3332
gem 'test-unit-minitest'
3433
end
35-

0 commit comments

Comments
 (0)