Skip to content

Commit 4abd19d

Browse files
authored
Merge pull request #732 from tadast/tt/ci
Improve CI setup
2 parents 00a038c + 2281b73 commit 4abd19d

8 files changed

Lines changed: 1863 additions & 4394 deletions

File tree

.github/workflows/tests.yml

Lines changed: 53 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
1-
# Run the old Travis tests within GitHub Actions, and upload the CodeClimate Report
2-
#
31
# If nektos/act is installed as a GitHub CLI extension...
42
# https://github.com/nektos/act#installation-as-github-cli-extension
53
# ...then run this locally with:
64
# gh act -j test
75
# Appending to $PATH: https://www.scivision.dev/github-actions-path-append/
8-
# Conditionals predicated on status-codes:
9-
# https://github.com/orgs/community/discussions/25809
10-
#
11-
# One can *try* action-validator, but there are false-negatives:
12-
# (https://github.com/mpalmer/action-validator
13-
#
14-
# State does *not* persist between jobs...
15-
# https://github.com/actions/checkout/issues/19
16-
# ...so all this needs to happen in a single job.
17-
#
6+
187
name: Tests
198
on:
209
push:
2110
branches:
22-
- 1.0.x
2311
- master
2412
pull_request:
2513
branches:
26-
- 1.0.x
2714
- master
2815
env:
2916
CC_TEST_REPORTER_ID: ec48bb03c72db6b43ce71fd488110b4707abfde4386c144d886d711378d8db64
@@ -32,31 +19,44 @@
3219
runs-on: ubuntu-latest
3320
steps:
3421
- uses: actions/checkout@v3
22+
3523
- name: Get BLAST
3624
working-directory: /opt
37-
run: wget -c "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.14.1/ncbi-blast-2.14.1+-x64-linux.tar.gz" && tar xvf ncbi-blast-*.tar.gz
25+
run: wget -c "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.15.0/ncbi-blast-2.15.0+-x64-linux.tar.gz" && tar xvf ncbi-blast-*.tar.gz
26+
3827
- name: BLAST PATH
39-
run: mkdir /opt/bin && echo "/opt/bin:/opt/ncbi-blast-2.14.1+/bin" >> $GITHUB_PATH
40-
- uses: browser-actions/setup-chrome@latest
41-
- run: chrome --version
28+
run: mkdir /opt/bin && echo "/opt/bin:/opt/ncbi-blast-2.15.0+/bin" >> $GITHUB_PATH
29+
4230
- name: Get CodeClimate
4331
working-directory: /opt
4432
run: wget -c "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" -O bin/cc-test-reporter && chmod +x bin/cc-test-reporter
33+
34+
- uses: browser-actions/setup-chrome@latest
35+
- run: chrome --version
36+
4537
- name: Set up Ruby
4638
uses: ruby/setup-ruby@v1
4739
with:
4840
ruby-version: '3.2'
4941
bundler-cache: true
42+
5043
- name: Install Ruby dependencies
5144
run: bundle install
45+
5246
- name: Setup Node.js
5347
uses: actions/setup-node@v3
5448
with:
5549
node-version: '16'
50+
5651
- name: Install NPM Dependencies
5752
run: npm install
53+
54+
- name: Instal Jest
55+
run: npm install --save-dev jest
56+
5857
- name: Build JS and CSS assets
5958
run: npm run build
59+
6060
- name: Check assets were compiled and checked-in
6161
continue-on-error: true
6262
run: |
@@ -66,23 +66,47 @@
6666
echo "Changes detected in 'public' directory. Please compile assets locally and commit the changes."
6767
exit 1
6868
fi
69+
6970
- name: Create SequenceServer config file
7071
run: bundle exec bin/sequenceserver -s -d spec/database/v5/sample
72+
7173
- name: CodeClimate before-build hook
7274
run: cc-test-reporter before-build
75+
7376
- name: Run main specs and import spec for BLAST 2.9.0+
74-
id: rspec
75-
continue-on-error: true
77+
id: rspec_tests
7678
run: bundle exec rspec spec/*_spec.rb spec/blast_versions/blast_2.9.0/*
77-
- name: CodeClimate after-build (success)
78-
if: steps.rspec.outcome == 'success'
79-
run: cc-test-reporter after-build --exit-code 0
80-
- name: CodeClimate after-build (failure)
81-
if: steps.rspec.outcome != 'success'
82-
run: cc-test-reporter after-build --exit-code 1
83-
- name: upload code coverage results
79+
continue-on-error: true
80+
81+
- name: upload rspec coverage report
8482
uses: actions/upload-artifact@v3
85-
if: success() || failure()
8683
with:
87-
name: code-coverage-report
84+
name: rspec-code-coverage-report
8885
path: coverage
86+
87+
- name: format-coverage (Rspec)
88+
run: cc-test-reporter format-coverage --output coverage/codeclimate_rspec.json
89+
90+
- name: Jest tests
91+
id: jest_tests
92+
run: npm test -- --coverage
93+
continue-on-error: true
94+
95+
- name: upload Jest coverage report
96+
uses: actions/upload-artifact@v3
97+
with:
98+
name: jest-code-coverage-report
99+
path: coverage/lcov-report/
100+
101+
- name: format-coverage (Jest)
102+
run: cc-test-reporter format-coverage coverage/lcov.info --input-type lcov --output coverage/codeclimate_jest.json
103+
104+
- name: sum-coverage
105+
run: cc-test-reporter sum-coverage --parts 2 coverage/codeclimate_*.json
106+
107+
- name: upload coverage to code-CodeClimate
108+
run: cc-test-reporter upload-coverage
109+
110+
- name: Assert both test suites passed in full
111+
if: steps.rspec_tests.outcome != 'success' || steps.jest_tests.outcome != 'success'
112+
run: exit 1

.travis.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

Gemfile.lock

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ GEM
1818
public_suffix (>= 2.0.2, < 6.0)
1919
ast (2.4.2)
2020
base64 (0.2.0)
21-
capybara (3.39.2)
21+
capybara (3.40.0)
2222
addressable
2323
matrix
2424
mini_mime (>= 0.1.3)
25-
nokogiri (~> 1.8)
25+
nokogiri (~> 1.11)
2626
rack (>= 1.6.0)
2727
rack-test (>= 0.6.3)
2828
regexp_parser (>= 1.5, < 3.0)
@@ -31,8 +31,8 @@ GEM
3131
capybara (>= 1.0, < 4)
3232
launchy
3333
coderay (1.1.3)
34-
diff-lcs (1.5.0)
35-
docile (1.3.2)
34+
diff-lcs (1.5.1)
35+
docile (1.4.0)
3636
domain_name (0.5.20190701)
3737
unf (>= 0.0.5, < 1.0.0)
3838
http-accept (1.7.0)
@@ -52,7 +52,7 @@ GEM
5252
mustermann (3.0.0)
5353
ruby2_keywords (~> 0.0.1)
5454
netrc (0.11.0)
55-
nokogiri (1.15.4)
55+
nokogiri (1.16.2)
5656
mini_portile2 (~> 2.8.2)
5757
racc (~> 1.4)
5858
ox (2.14.16)
@@ -83,19 +83,19 @@ GEM
8383
mime-types (>= 1.16, < 4.0)
8484
netrc (~> 0.8)
8585
rexml (3.2.6)
86-
rspec (3.12.0)
87-
rspec-core (~> 3.12.0)
88-
rspec-expectations (~> 3.12.0)
89-
rspec-mocks (~> 3.12.0)
90-
rspec-core (3.12.2)
91-
rspec-support (~> 3.12.0)
92-
rspec-expectations (3.12.3)
86+
rspec (3.13.0)
87+
rspec-core (~> 3.13.0)
88+
rspec-expectations (~> 3.13.0)
89+
rspec-mocks (~> 3.13.0)
90+
rspec-core (3.13.0)
91+
rspec-support (~> 3.13.0)
92+
rspec-expectations (3.13.0)
9393
diff-lcs (>= 1.2.0, < 2.0)
94-
rspec-support (~> 3.12.0)
95-
rspec-mocks (3.12.6)
94+
rspec-support (~> 3.13.0)
95+
rspec-mocks (3.13.0)
9696
diff-lcs (>= 1.2.0, < 2.0)
97-
rspec-support (~> 3.12.0)
98-
rspec-support (3.12.1)
97+
rspec-support (~> 3.13.0)
98+
rspec-support (3.13.1)
9999
rubocop (1.50.2)
100100
json (~> 2.3)
101101
parallel (~> 1.10)
@@ -111,15 +111,17 @@ GEM
111111
ruby-progressbar (1.13.0)
112112
ruby2_keywords (0.0.5)
113113
rubyzip (2.3.2)
114-
selenium-webdriver (4.15.0)
114+
selenium-webdriver (4.18.1)
115+
base64 (~> 0.2)
115116
rexml (~> 3.2, >= 3.2.5)
116117
rubyzip (>= 1.2.2, < 3.0)
117118
websocket (~> 1.0)
118-
simplecov (0.17.1)
119+
simplecov (0.22.0)
119120
docile (~> 1.1)
120-
json (>= 1.8, < 3)
121-
simplecov-html (~> 0.10.0)
122-
simplecov-html (0.10.2)
121+
simplecov-html (~> 0.11)
122+
simplecov_json_formatter (~> 0.1)
123+
simplecov-html (0.12.3)
124+
simplecov_json_formatter (0.1.4)
123125
sinatra (4.0.0)
124126
mustermann (~> 3.0)
125127
rack (>= 3.0.0, < 4)
@@ -141,15 +143,15 @@ PLATFORMS
141143
ruby
142144

143145
DEPENDENCIES
144-
capybara (~> 3.15, >= 3.15.1)
146+
capybara (~> 3.40, >= 3.40.0)
145147
capybara-screenshot (~> 1.0, >= 1.0.23)
146148
pry
147149
rack-test (~> 2.1)
148-
rspec (~> 3.7, >= 3.7.0)
150+
rspec (~> 3.13, >= 3.13.0)
149151
rubocop (~> 1.50, >= 1.50.1)
150-
selenium-webdriver (~> 4.15.0, >= 4.15.0)
152+
selenium-webdriver (~> 4.18.0, >= 4.18.1)
151153
sequenceserver!
152-
simplecov (~> 0.17.0, >= 0.17.0)
154+
simplecov (~> 0.22.0, >= 0.22.0)
153155

154156
BUNDLED WITH
155157
2.4.16

jest.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ module.exports = {
33
roots: [
44
'<rootDir>/public/js'
55
],
6-
collectCoverageFrom: [
7-
'<rootDir>/public/js/**/*.{js,jsx,ts,tsx}',
8-
'!<rootDir>/public/js/**/*.d.ts'
9-
],
106
setupFiles: [
117
'react-app-polyfill/jsdom'
128
],
@@ -45,6 +41,7 @@ module.exports = {
4541
'download_links': '<rootDir>/public/js/null_plugins/download_links.js',
4642
'hit_buttons': '<rootDir>/public/js/null_plugins/hit_buttons.js',
4743
'search_header_plugin': '<rootDir>/public/js/null_plugins/search_header_plugin.js',
44+
'circos$': '<rootDir>/public/js/tests/mocks/circos.js',
4845
},
4946
watchPlugins: [
5047
'jest-watch-typeahead/filename',

0 commit comments

Comments
 (0)