-
Notifications
You must be signed in to change notification settings - Fork 11
58 lines (54 loc) · 2.43 KB
/
run-tests-automatically.yml
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
name: Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '10'
- name: Set up Chrome
uses: browser-actions/setup-chrome@latest
- name: Install Dependencies
run: |
echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list
wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y gdal-bin libgdal-dev postgresql-14-postgis-3 timescaledb-2-postgresql-14
sudo bash -c "echo \"shared_preload_libraries = 'timescaledb'\" >>/etc/postgresql/14/main/postgresql.conf"
sudo service postgresql restart
sudo -u postgres psql -U postgres -c "create extension postgis"
sudo -u postgres psql -U postgres -c "create user runner password 'topsecret' superuser"
sudo -u postgres psql -U postgres -c "create database openmeteo owner runner"
python -m pip install --upgrade pip 'setuptools<58' # See https://stackoverflow.com/questions/69123406
CPLUS_INCLUDE_PATH=/usr/include/gdal C_INCLUDE_PATH=/usr/include/gdal pip install 'gdal==3.4.1'
pip install 'psycopg2>=2.8,<2.9' codecov coverage isort flake8 'black>=22.8,<23'
wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/`google-chrome --version|awk '{ print $3 }'`/linux64/chromedriver-linux64.zip
sudo unzip chromedriver-linux64.zip -d /usr/local/bin
pip install -r requirements.txt
pip install -r requirements-dev.txt
npm install
cp enhydris_project/settings/ci.py enhydris_project/settings/local.py
- name: Run Tests
run: |
python manage.py makemigrations --check
black --check .
flake8 --max-line-length=88 .
isort --check-only --diff .
npm run lint
coverage run --include="./*" --omit="*/tests/*","*/tests.py","*/migrations/*","./enhydris_project/*" manage.py test -v2
npm run test
codecov