Skip to content

Commit

Permalink
Merge pull request #861 from neuroscout/github_actions
Browse files Browse the repository at this point in the history
Switch to Github Actions for CI
  • Loading branch information
adelavega committed Jan 8, 2021
2 parents 06ea42f + 4c1872f commit 796f12d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 48 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Neuroscout tests

on: [push, pull_request]

jobs:
test:
name: pytest
runs-on: ubuntu-latest
env:
APP_SETTINGS: neuroscout.config.app.GHIConfig
PYTHONHASHSEED: 0
services:
postgres:
image: postgres:12
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: travis_ci_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Set up system dependencies
run: |
bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
sudo apt-get -qq update
sudo apt-get install -yq git-annex-standalone tesseract-ocr libavformat-dev libavfilter-dev libavdevice-dev ffmpeg
cp neuroscout/config/example_app.py neuroscout/config/app.py
cp neuroscout/frontend/src/config.ts.example neuroscout/frontend/src/config.ts
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('neuroscout/setup.py') }}-${{ hashFiles('neuroscout/requirements.txt') }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -U setuptools==45 pytest-cov
python -m pip install -r neuroscout/requirements.txt
python -m pip install -e git+https://github.com/PsychoinformaticsLab/pliers.git#egg=pliers
python -m pliers.support.download
- name: Test with pytest
run: |
python -m pytest neuroscout/tests/ --cov=./neuroscout --cov-report xml
- uses: codecov/codecov-action@v1
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions neuroscout/config/example_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ class DockerTestConfig(TestingConfig):
FILE_DIR = Path('/tmp/file-data')


class TravisConfig(TestingConfig):
SQLALCHEMY_DATABASE_URI = "postgresql://postgres@localhost/travis_ci_test"
class GHIConfig(TestingConfig):
SQLALCHEMY_DATABASE_URI = "postgresql://postgres:password@localhost/travis_ci_test"
FILE_DIR = Path('./tmp/file-data').absolute()
3 changes: 1 addition & 2 deletions neuroscout/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ patsy
Pillow==7.1.0
progressbar2
psycopg2==2.8.3
py==1.4.33
PyJWT==1.4.2
pyld==0.7.3
pyparsing==2.2.0
pytest==3.0.7
pytest>4.6
python-dateutil==2.6.0
python-magic==0.4.13
pytz==2017.2
Expand Down

0 comments on commit 796f12d

Please sign in to comment.