-
Notifications
You must be signed in to change notification settings - Fork 57
103 lines (98 loc) · 3.58 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
on: [push, pull_request]
name: continuous integration
defaults:
run:
shell: bash
jobs:
lint-python:
runs-on: ubuntu-22.04
steps:
- name: Set python env
run: echo "PYTHONPATH=$(pwd)/django/projects/" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- run: |
pip install "$(grep -E '^flake8' django/requirements-test.txt)"
pip install "$(grep -E '^mypy' django/requirements-test.txt)"
pip install -r django/requirements-types.txt
name: Install lint tools
- run: flake8 --statistics --count django
- run: mypy django/
lint-javascript:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- run: npm install
- run: npm run lint:js-diff
name: Check lint errors against blessed failures
- run: npm run jsdoc
name: Ensure that docs are valid
test-backend:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# For PyPy use 'pypy-3.10'. It is disabled by default due to long build times.
python-version: ['3.9', '3.10']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: bash scripts/travis/install_postgres.sh
- run: sudo apt-get install -y -qq $(< packagelist-ubuntu-apt.txt)
name: Install ubuntu requirements
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-py_${{ matrix.python-version }}-${{ hashFiles('django/requirements*.txt') }}
- run: pip install ./django[test,async] coveralls
- run: bash scripts/travis/setup_database.sh
- run: bash scripts/travis/configure_catmaid.sh
- run: bash scripts/travis/configure_pypy_libs.sh
if: ${{ matrix.python-version == 'pypy3' }}
- run: django/projects/manage.py migrate --noinput
name: Apply migrations
- run: django/projects/manage.py makemigrations catmaid
name: Check migrations are up to date
- run: coverage run django/projects/manage.py test catmaid.tests
name: Run tests
test-frontend:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- run: npm install
- run: bash scripts/travis/install_postgres.sh
- run: sudo apt-get install -y -qq $(< packagelist-ubuntu-apt.txt)
name: Install ubuntu requirements
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-py_${{ matrix.python-version }}-${{ hashFiles('django/requirements.txt') }}
- run: pip install ./django
- run: bash scripts/travis/setup_database.sh
- run: bash scripts/travis/configure_catmaid.sh
- run: python django/projects/manage.py migrate --noinput
name: Apply migrations
- run: python django/projects/manage.py collectstatic --link --noinput
- run: |
sed -i 's/login_required(\([^)]*\))/\1/g' django/applications/catmaid/urls.py
python -Wall -Wignore::ImportWarning django/projects/manage.py runserver &
sleep 5
name: Start development server
- run: npm run karma