Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Github Actions for CI #861

Merged
merged 11 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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