Skip to content

Commit

Permalink
Add a github actions CI setup (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
rth committed Nov 10, 2020
1 parent 31f5577 commit 9565765
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 54 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: main

on: [push, pull_request]


jobs:
main:
name: test-py-${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
python: [3.6, 3.7, 3.8]

services:
postgres:
image: postgres:11.6-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
# Add a health check
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5


steps:
- uses: actions/checkout@v2

- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
activate-conda: false
python-version: ${{ matrix.python }}
conda-channels: anaconda

- name: Create envs
run: |
conda create --yes -n testenv python=$PYTHON_VERSION
conda env update -n testenv -f environment.yml
conda env create -f ci_tools/environment_iris_kit.yml
env:
PYTHON_VERSION: ${{ matrix.python }}

- name: Install ramp-board
run: |
source activate testenv
make inplace
env:
PYTHON_VERSION: ${{ matrix.python }}

- name: Test ramp-frontend
run: |
set -e
source activate testenv
python -m smtpd -n -c DebuggingServer 127.0.0.1:8025 &
sleep 3 # wait for the server to start
pytest -rvsl ramp-frontend --cov=ramp_frontend --cov-report=term-missing --cov-report=xml --cov-append
- name: Test ramp-engine
run: |
set -e
source activate testenv
pytest -rvsl ramp-engine/ --cov=ramp_engine --cov-report=term-missing --cov-report=xml --cov-append
- name: Test ramp-database
run: |
set -e
source activate testenv
pytest -rvsl ramp-database/ --cov=ramp_database --cov-report=term-missing --cov-report=xml --cov-append
- name: Test ramp-utils
run: |
set -e
source activate testenv
pytest -rvsl ramp-utils/ --cov=ramp_utils --cov-report=term-missing --cov-report=xml --cov-append
- name: Test integration
run: |
set -e
source activate testenv
bash ci_tools/actions/integration_test.sh
- uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
verbose: true
file: ./coverage.xml

lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'

- name: Install dependencies
run: pip install flake8

- name: Run flake8
run: flake8 ramp-*
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ test_submissions/submission*
.pytest_cache
*.egg-info
databoard.db
db_engine.yml
db_engine.yml
coverage.xml
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
set -e
set -ex
cd $HOME
mkdir ramp_deployment
cd ramp_deployment
psql -U postgres -c "CREATE USER mrramp WITH PASSWORD 'mrramp';ALTER USER mrramp WITH SUPERUSER;"
createdb --owner=mrramp databoard_test
psql -U postgres -h 127.0.0.1 -c "CREATE USER mrramp WITH PASSWORD 'mrramp';ALTER USER mrramp WITH SUPERUSER;"
createdb -U postgres -h 127.0.0.1 --owner=mrramp databoard_test
ramp setup init

echo "flask:
Expand Down Expand Up @@ -41,4 +41,4 @@ ramp setup deploy-event --event-config events/iris_test/config.yml
ramp-database approve-user --login admin_user
ramp-database sign-up-team --event iris_test --team admin_user
ramp database add-submission --event iris_test --team admin_user --submission my_submission --path "$HOME/ramp_deployment/ramp-kits/iris/submissions/random_forest_10_10"
ramp launch dispatcher --event-config events/iris_test/config.yml -vv
ramp launch dispatcher --event-config events/iris_test/config.yml -vv
4 changes: 0 additions & 4 deletions ci_tools/travis/test_ramp_database.sh

This file was deleted.

4 changes: 0 additions & 4 deletions ci_tools/travis/test_ramp_engine.sh

This file was deleted.

4 changes: 0 additions & 4 deletions ci_tools/travis/test_ramp_frontend.sh

This file was deleted.

4 changes: 0 additions & 4 deletions ci_tools/travis/test_ramp_utils.sh

This file was deleted.

2 changes: 0 additions & 2 deletions ramp-engine/ramp_engine/tests/test_dispatcher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import shutil
import os
from time import sleep

import pytest

Expand All @@ -16,7 +15,6 @@
from ramp_database.tools.event import get_event
from ramp_database.tools.submission import get_submissions
from ramp_database.tools.submission import get_submission_by_id
from ramp_database.tools.submission import set_submission_state

from ramp_engine.local import CondaEnvWorker
from ramp_engine.dispatcher import Dispatcher
Expand Down

0 comments on commit 9565765

Please sign in to comment.