forked from cms-dev/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 2.52 KB
/
main.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
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
name: ci
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:12
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y \
build-essential \
php7.4-cli \
haskell-platform \
fp-compiler \
python2.7 \
cppreference-doc-en-html \
cgroup-lite \
libcap-dev \
python-dev \
libpq-dev \
libcups2-dev \
libyaml-dev \
rustc \
mono-mcs
- name: Install requirements
run: |
# Use distutils from the standard library for 2to3 translation
export SETUPTOOLS_USE_DISTUTILS="stdlib"
pip install -U pip setuptools wheel
pip install -r requirements.txt
pip install -r dev-requirements.txt
sudo $(which python) prerequisites.py -y --cmsuser=$USER install
python setup.py install
- name: Set up database
env:
PGPASSWORD: postgres
run: |
psql --host=localhost --username=postgres --command="CREATE USER cmsuser WITH PASSWORD 'your_password_here';"
createdb --host=localhost --username=postgres --owner=cmsuser cmsdb
psql --host=localhost --username=postgres --dbname=cmsdb --command='ALTER SCHEMA public OWNER TO cmsuser'
psql --host=localhost --username=postgres --dbname=cmsdb --command='GRANT SELECT ON pg_largeobject TO cmsuser'
createdb --host=localhost --username=postgres --owner=cmsuser cmsdbfortesting
psql --host=localhost --username=postgres --dbname=cmsdbfortesting --command='ALTER SCHEMA public OWNER TO cmsuser'
psql --host=localhost --username=postgres --dbname=cmsdbfortesting --command='GRANT SELECT ON pg_largeobject TO cmsuser'
cp ./config/cms.conf.sample ./config/cms.conf
sed -e "s/\"cmsuser\": \"cmsuser\"/\"cmsuser\": \"$USER\"/" -i ./config/cms.conf
cmsInitDB
- name: Run tests
run: |
cmsRunTests -v --coverage --codecov