forked from Scifabric/pybossa
-
Notifications
You must be signed in to change notification settings - Fork 12
82 lines (73 loc) · 2.61 KB
/
github-actions.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
name: Bloomberg Pybossa
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
services:
postgres:
image: postgres:13.6
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- name: Checkout repository and submodules recursively
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pre installation
env:
REDIS_VERSION: 6.2.7
run: |
wget https://download.redis.io/releases/redis-$REDIS_VERSION.tar.gz
tar -xzf redis-$REDIS_VERSION.tar.gz
cd redis-$REDIS_VERSION && make install && cd ..
sudo apt-get update -y
sudo apt-get install -y libxml2-dev libxmlsec1-dev libsasl2-dev libldap2-dev libssl-dev libkrb5-dev libpq-dev postgresql-client
redis-server --version
redis-server contrib/redis/sentinel.conf --sentinel
redis-server&
cd pybossa && ln -s themes/default/translations && cd ..
cp settings_test.py.tmpl pybossa/settings_test.py
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -r requirements.txt
python -m pip install otpauth
- name: Testing Redis
run: |
redis-cli info
redis-cli set foo 1
redis-cli get foo
- name: Setting up PostgreSQL DB
run: |
psql -U postgres -h localhost -c "create user rtester with createdb login password 'rtester'"
psql -U postgres -h localhost -c "create database pybossa_test owner rtester encoding 'UTF-8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8' template template0;"
alembic -c alembictest.ini stamp head
alembic -c alembictest.ini upgrade head
env:
PGPASSWORD: postgres
- name: Run unit test
run: |
echo "::remove-matcher owner=python::"
./run_tests
- name: Run code coverage
run: |
python -m pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}