sintonia/.github/workflows/test-all-Ubuntu.yml

78 lines
2.6 KiB
YAML

name: test-all-Ubuntu
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
types: [opened, ready_for_review, review_requested]
paths-ignore:
- 'docs/**'
workflow_dispatch:
jobs:
test-bionic:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Setup PostgreSQL
run: |
sudo systemctl start postgresql.service
pg_isready
sudo -u postgres psql -c 'CREATE DATABASE libretime;'
sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';"
sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;'
sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;'
- name: Setup PHP with specific version
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
- name: Install prerequisites
run: |
ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime
sudo bash ./.github/scripts/install-bionic.sh
- name: Run Python tests
run: |
sudo bash ./.github/scripts/python-pkg-install.sh
./.github/scripts/python-pkg-test.sh
- name: Run PHP tests
run: |
composer install --no-progress --dev
cd airtime_mvc/tests
php ../../vendor/bin/phpunit
test-xenial:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.5'
- name: Setup PostgreSQL
run: |
sudo systemctl start postgresql.service
pg_isready
sudo -u postgres psql -c 'CREATE DATABASE libretime;'
sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';"
sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;'
sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;'
- name: Setup PHP with specific version
uses: shivammathur/setup-php@v2
with:
php-version: '7.0'
- name: Install prerequisites
run: |
ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime
sudo bash ./.github/scripts/install-xenial.sh
- name: Run Python tests
run: |
pip install --upgrade pip
sudo bash ./.github/scripts/python-pkg-install.sh
sudo bash ./.github/scripts/python-pkg-test.sh
- name: Run PHP tests
run: |
composer install --no-progress --dev
cd airtime_mvc/tests
php ../../vendor/bin/phpunit