Skip to content

tmp

tmp #19

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: unit-tests
on:
push:
pull_request_target:
types: [ opened, reopened ]
env:
API_URL: ${{ secrets.API_URL }}
API_KEY: ${{ secrets.API_KEY }}
BIOMIXER_URL: ${{ secrets.BIOMIXER_URL }}
FAIRNESS_URL: ${{ secrets.FAIRNESS_URL }}
ANNOTATOR_URL: ${{ secrets.ANNOTATOR_URL }}
DB_HOST: ${{ secrets.DB_HOST || '127.0.0.1' }}
DB_PORT: ${{ secrets.DB_PORT || 3306 }}
RAILS_ENV: test
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.6 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: set up config file
run: cp .env.sample .env && cp config/database.yml.sample config/database.yml
- name: build docker
run: docker compose --profile cache-db up -d
- name: wait for MySQL to start
run: |
for i in {1..10}; do
if nc -z ${{ env.DB_HOST }} ${{ env.DB_PORT }}; then
break
fi
sleep 1
done
- name: run test docker
run: RAILS_ENV=test bin/rails db:setup && bin/rails test -v