2021-05-31 10:54:07 +02:00
|
|
|
name: Python and PHP Tests
|
2020-12-01 03:00:10 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
2021-05-27 16:20:34 +02:00
|
|
|
- "docs/**"
|
2020-12-01 03:15:42 +01:00
|
|
|
pull_request:
|
2021-05-27 16:20:34 +02:00
|
|
|
types:
|
|
|
|
[
|
|
|
|
opened,
|
|
|
|
ready_for_review,
|
|
|
|
review_requested,
|
|
|
|
edited,
|
|
|
|
reopened,
|
|
|
|
synchronize,
|
|
|
|
]
|
2020-12-01 03:15:42 +01:00
|
|
|
paths-ignore:
|
2021-05-27 16:20:34 +02:00
|
|
|
- "docs/**"
|
2020-12-01 03:34:16 +01:00
|
|
|
workflow_dispatch:
|
2021-05-21 15:30:26 +02:00
|
|
|
|
2020-12-01 03:00:10 +01:00
|
|
|
jobs:
|
2021-06-03 14:13:12 +02:00
|
|
|
pre-commit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- uses: pre-commit/action@v2.0.3
|
|
|
|
|
2020-12-18 15:48:43 +01:00
|
|
|
test-bionic:
|
|
|
|
runs-on: ubuntu-18.04
|
2021-05-21 15:41:06 +02:00
|
|
|
env:
|
|
|
|
ENVIRONMENT: testing
|
|
|
|
LIBRETIME_LOG_DIR: /tmp/log/libretime
|
2020-12-18 15:48:43 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
2021-05-27 16:20:34 +02:00
|
|
|
python-version: "3.6"
|
2020-12-18 15:48:43 +01:00
|
|
|
- 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:
|
2021-05-27 16:20:34 +02:00
|
|
|
php-version: "7.2"
|
2020-12-18 15:48:43 +01:00
|
|
|
- name: Install prerequisites
|
2021-05-27 16:20:34 +02:00
|
|
|
run: sudo -E ./.github/scripts/install-bionic.sh
|
2020-12-18 15:48:43 +01:00
|
|
|
- name: Run Python tests
|
|
|
|
run: |
|
2021-05-21 15:41:06 +02:00
|
|
|
sudo ./.github/scripts/python-pkg-install.sh
|
2021-05-21 15:30:26 +02:00
|
|
|
./.github/scripts/python-pkg-test.sh
|
2020-12-18 15:48:43 +01:00
|
|
|
- name: Run PHP tests
|
|
|
|
run: |
|
2020-12-18 17:23:21 +01:00
|
|
|
composer install --no-progress --dev
|
2020-12-18 15:48:43 +01:00
|
|
|
cd airtime_mvc/tests
|
2020-12-18 17:23:21 +01:00
|
|
|
php ../../vendor/bin/phpunit
|