Skip to content

Commit

Permalink
Merge 901c9df into ccbe4fa
Browse files Browse the repository at this point in the history
  • Loading branch information
juhuntenburg committed Jul 7, 2021
2 parents ccbe4fa + 901c9df commit 9717bfb
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 7 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev

jobs:
run_tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Build database
run: psql -c "CREATE DATABASE githubactions;" -U postgres -h localhost -p 5432
env:
PGPASSWORD: postgres
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install dependecies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install coverage coveralls
env:
PIP_USE_MIRRORS: true
- name: Run tests
run: |
sudo touch /var/log/alyx.log; sudo chmod 776 /var/log/alyx.log
sudo touch /var/log/alyx_json.log; sudo chmod 776 /var/log/alyx_json.log
cd alyx
coverage run manage.py test -n
coveralls --service=github
env:
DJANGO_SETTINGS_MODULE: alyx.settings
PYTHONPATH: $HOME/builds/cortexlab/alyx
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Flake
run: |
cd alyx
flake8 .
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# alyx

[![Build Status on master](https://travis-ci.org/cortex-lab/alyx.svg?branch=master)](https://travis-ci.org/cortex-lab/alyx)
[![Build Status on dev](https://travis-ci.org/cortex-lab/alyx.svg?branch=dev)](https://travis-ci.org/cortex-lab/alyx)
[![Github Actions](https://github.com/cortex-lab/alyx/actions/workflows/main.yml/badge.svg)](https://github.com/cortex-lab/alyx/actions/)
[![Coverage Status](https://coveralls.io/repos/github/cortex-lab/alyx/badge.svg?branch=github_action)](https://coveralls.io/github/cortex-lab/alyx?branch=master)

Database for experimental neuroscience laboratories

Expand Down
10 changes: 5 additions & 5 deletions alyx/alyx/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
DATE_INPUT_FORMATS = ('%d/%m/%Y',)


if 'TRAVIS' in os.environ:
if 'GITHUB_ACTIONS' in os.environ:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'travisci',
'ENGINE': 'django_prometheus.db.backends.postgresql',
'NAME': 'githubactions',
'USER': 'postgres',
'PASSWORD': '',
'PASSWORD': 'postgres',
'HOST': 'localhost',
'PORT': '',
'PORT': '5432',
}
}

Expand Down

0 comments on commit 9717bfb

Please sign in to comment.