FIx tests: downgrade Node #905
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Neuroscout tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
tests: | |
name: neuroscout tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
type: ['backend', 'frontend'] | |
services: | |
postgres: | |
image: postgres:12 | |
env: | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: 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.7 | |
- 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 libgconf-2-4 | |
cp neuroscout/config/example_app.py neuroscout/config/app.py | |
- 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 | |
env: | |
APP_SETTINGS: neuroscout.config.app.GHIConfigBackend | |
PYTHONHASHSEED: 0 | |
run: | | |
python -m pytest neuroscout/tests/ --cov=./neuroscout --cov-report xml | |
if: matrix.type == 'backend' | |
- uses: codecov/codecov-action@v1 | |
if: matrix.type == 'backend' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
if: matrix.type == 'frontend' | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
'neuroscout/frontend/node_modules' | |
~/.cache/Cypress | |
build | |
key: modules-${{ hashFiles('**/yarn.lock') }} | |
if: matrix.type == 'frontend' | |
- name: Install frontend dependencies | |
run: | | |
cd neuroscout/frontend | |
yarn install | |
if: matrix.type == 'frontend' | |
- name: Run frontend tests with backend | |
env: | |
APP_SETTINGS: neuroscout.config.app.GHIConfig | |
CHOKIDAR_USEPOLLING: 1 | |
run: | | |
bash setup_frontend_tests.sh | |
sleep 120 | |
echo "dont sleeping" | |
cd neuroscout/frontend && ./node_modules/.bin/cypress run --record --key ${{ secrets.CYPRESS_RECORD_KEY }} | |
if: matrix.type == 'frontend' |