Merge pull request #1017 from bloomberg/RDISCROWD-7842 #2573
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: 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 }} |