Merge branch 'wurmlab:master' into master #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run the old Travis tests within GitHub Actions, and upload the CodeClimate Report | |
# | |
# If nektos/act is installed as a GitHub CLI extension... | |
# https://github.com/nektos/act#installation-as-github-cli-extension | |
# ...then run this locally with: | |
# gh act -j test | |
# Appending to $PATH: https://www.scivision.dev/github-actions-path-append/ | |
# Conditionals predicated on status-codes: | |
# https://github.com/orgs/community/discussions/25809 | |
# | |
# One can *try* action-validator, but there are false-negatives: | |
# (https://github.com/mpalmer/action-validator | |
# | |
# State does *not* persist between jobs... | |
# https://github.com/actions/checkout/issues/19 | |
# ...so all this needs to happen in a single job. | |
# | |
name: Tests | |
on: | |
push: | |
branches: | |
- 1.0.x | |
- master | |
pull_request: | |
branches: | |
- 1.0.x | |
- master | |
env: | |
CC_TEST_REPORTER_ID: ec48bb03c72db6b43ce71fd488110b4707abfde4386c144d886d711378d8db64 | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get BLAST | |
working-directory: /opt | |
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 | |
- name: BLAST PATH | |
run: mkdir /opt/bin && echo "/opt/bin:/opt/ncbi-blast-2.14.1+/bin" >> $GITHUB_PATH | |
- uses: browser-actions/setup-chrome@latest | |
- run: chrome --version | |
- name: Get CodeClimate | |
working-directory: /opt | |
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 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2' | |
bundler-cache: true | |
- name: Install Ruby dependencies | |
run: bundle install | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Install NPM Dependencies | |
run: npm install | |
- name: Build JS and CSS assets | |
run: npm run build | |
- name: Check assets were compiled and checked-in | |
continue-on-error: true | |
run: | | |
if git diff --quiet --exit-code -- public; then | |
echo "No changes in 'public' directory." | |
else | |
echo "Changes detected in 'public' directory. Please compile assets locally and commit the changes." | |
exit 1 | |
fi | |
- name: Create SequenceServer config file | |
run: bundle exec bin/sequenceserver -s -d spec/database/v5/sample | |
- name: CodeClimate before-build hook | |
run: cc-test-reporter before-build | |
- name: Run main specs and import spec for BLAST 2.9.0+ | |
id: rspec | |
continue-on-error: true | |
run: bundle exec rspec spec/*_spec.rb spec/blast_versions/blast_2.9.0/* | |
- name: CodeClimate after-build (success) | |
if: steps.rspec.outcome == 'success' | |
run: cc-test-reporter after-build --exit-code 0 | |
- name: CodeClimate after-build (failure) | |
if: steps.rspec.outcome != 'success' | |
run: cc-test-reporter after-build --exit-code 1 | |
- name: upload code coverage results | |
uses: actions/upload-artifact@v3 | |
if: success() || failure() | |
with: | |
name: code-coverage-report | |
path: coverage |